mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
C and Objective Caml bindings for getFunction and getNamedGlobal. Also enhanced
the Objective Caml 'declare_*' functions to behave more or less like getOrInsertFunction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42740 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -532,6 +532,10 @@ LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name) {
|
||||
GlobalValue::ExternalLinkage, 0, Name, unwrap(M)));
|
||||
}
|
||||
|
||||
LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name) {
|
||||
return wrap(unwrap(M)->getNamedGlobal(Name));
|
||||
}
|
||||
|
||||
void LLVMDeleteGlobal(LLVMValueRef GlobalVar) {
|
||||
unwrap<GlobalVariable>(GlobalVar)->eraseFromParent();
|
||||
}
|
||||
@@ -576,6 +580,10 @@ LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name,
|
||||
GlobalValue::ExternalLinkage, Name, unwrap(M)));
|
||||
}
|
||||
|
||||
LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name) {
|
||||
return wrap(unwrap(M)->getFunction(Name));
|
||||
}
|
||||
|
||||
void LLVMDeleteFunction(LLVMValueRef Fn) {
|
||||
unwrap<Function>(Fn)->eraseFromParent();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user