File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -2988,6 +2988,22 @@ LLVM_C_ABI char *LLVMIntrinsicCopyOverloadedName2(LLVMModuleRef Mod,
2988
2988
*/
2989
2989
LLVM_C_ABI LLVMBool LLVMIntrinsicIsOverloaded (unsigned ID );
2990
2990
2991
+ /**
2992
+ * Obtain or insert a function into a module.
2993
+ *
2994
+ * If a function with the specified name already exists in the module, it
2995
+ * is returned. Otherwise, a new function is created in the module with the
2996
+ * specified name and type and is returned.
2997
+ *
2998
+ * The returned value corresponds to a llvm::Function instance.
2999
+ *
3000
+ * @see llvm::Module::getOrInsertFunction()
3001
+ */
3002
+ LLVM_C_ABI LLVMValueRef LLVMGetOrInsertFunction (LLVMModuleRef M ,
3003
+ const char * Name ,
3004
+ size_t NameLen ,
3005
+ LLVMTypeRef FunctionTy );
3006
+
2991
3007
/**
2992
3008
* Obtain the calling function of a function.
2993
3009
*
Original file line number Diff line number Diff line change @@ -2523,6 +2523,14 @@ LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID) {
2523
2523
return llvm::Intrinsic::isOverloaded (IID);
2524
2524
}
2525
2525
2526
+ LLVMValueRef LLVMGetOrInsertFunction (LLVMModuleRef M, const char *Name,
2527
+ size_t NameLen, LLVMTypeRef FunctionTy) {
2528
+ return wrap (unwrap (M)
2529
+ ->getOrInsertFunction (StringRef (Name, NameLen),
2530
+ unwrap<FunctionType>(FunctionTy))
2531
+ .getCallee ());
2532
+ }
2533
+
2526
2534
unsigned LLVMGetFunctionCallConv (LLVMValueRef Fn) {
2527
2535
return unwrap<Function>(Fn)->getCallingConv ();
2528
2536
}
You can’t perform that action at this time.
0 commit comments