diff options
author | Gordon Henriksen <gordonhenriksen@mac.com> | 2007-10-07 17:31:42 +0000 |
---|---|---|
committer | Gordon Henriksen <gordonhenriksen@mac.com> | 2007-10-07 17:31:42 +0000 |
commit | c84c16be9b29b4f805b92bfc2d93e2dfaa952f8f (patch) | |
tree | b1151b7c8c7899327eda9b24b4903fd8b067f442 /lib/VMCore/Core.cpp | |
parent | f16c595252de363e0e1f6895a5a626bc30017053 (diff) | |
download | external_llvm-c84c16be9b29b4f805b92bfc2d93e2dfaa952f8f.zip external_llvm-c84c16be9b29b4f805b92bfc2d93e2dfaa952f8f.tar.gz external_llvm-c84c16be9b29b4f805b92bfc2d93e2dfaa952f8f.tar.bz2 |
C and Objective Caml bindings for GlobalVariable::isConstant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42736 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Core.cpp')
-rw-r--r-- | lib/VMCore/Core.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp index 15a54b3..66ab03c 100644 --- a/lib/VMCore/Core.cpp +++ b/lib/VMCore/Core.cpp @@ -557,6 +557,17 @@ void LLVMSetThreadLocal(LLVMValueRef GlobalVar, int IsThreadLocal) { unwrap<GlobalVariable>(GlobalVar)->setThreadLocal(IsThreadLocal != 0); } +int LLVMIsGlobalConstant(LLVMValueRef GlobalVar) { + bool res = unwrap<GlobalVariable>(GlobalVar)->isConstant(); + fprintf(stderr, "LLVMIsConstantGlobal(0x%08x) = %s\n", + (int) GlobalVar, res? "YES" : "NO"); + return unwrap<GlobalVariable>(GlobalVar)->isConstant(); +} + +void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, int IsConstant) { + unwrap<GlobalVariable>(GlobalVar)->setConstant(IsConstant != 0); +} + /*--.. Operations on functions .............................................--*/ LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name, |