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
This commit is contained in:
Gordon Henriksen
2007-10-07 17:31:42 +00:00
parent f16c595252
commit c84c16be9b
7 changed files with 70 additions and 1 deletions

View File

@@ -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,