llvm.org GIT mirror llvm / 45fd445
[LLVM-C] Add binding to look up intrinsic by name Summary: Add a binding to Function::lookupIntrinsicID so clients don't have to go searching the ID table themselves. Reviewers: whitequark, deadalnix Reviewed By: whitequark Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59697 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356948 91177308-0d34-0410-b5e6-96231b3b80d8 Robert Widmann 4 months ago
2 changed file(s) with 11 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
24022402 void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn);
24032403
24042404 /**
2405 * Obtain the intrinsic ID number which matches the given function name.
2406 *
2407 * @see llvm::Function::lookupIntrinsicID()
2408 */
2409 unsigned LLVMLookupIntrinsicID(const char *Name, size_t NameLen);
2410
2411 /**
24052412 * Obtain the ID number from a function instance.
24062413 *
24072414 * @see llvm::Function::getIntrinsicID()
23282328 return strdup(Str.c_str());
23292329 }
23302330
2331 unsigned LLVMLookupIntrinsicID(const char *Name, size_t NameLen) {
2332 return Function::lookupIntrinsicID({Name, NameLen});
2333 }
2334
23312335 LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID) {
23322336 auto IID = llvm_map_to_intrinsic_id(ID);
23332337 return llvm::Intrinsic::isOverloaded(IID);