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,
29882988 */
29892989LLVM_C_ABI LLVMBool LLVMIntrinsicIsOverloaded (unsigned ID );
29902990
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+
29913007/**
29923008 * Obtain the calling function of a function.
29933009 *
Original file line number Diff line number Diff line change @@ -2523,6 +2523,14 @@ LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID) {
25232523 return llvm::Intrinsic::isOverloaded (IID);
25242524}
25252525
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+
25262534unsigned LLVMGetFunctionCallConv (LLVMValueRef Fn) {
25272535 return unwrap<Function>(Fn)->getCallingConv ();
25282536}
You can’t perform that action at this time.
0 commit comments