[PATCH] D59697: [LLVM-C] Add binding to look up intrinsic by name

Robert Widmann via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 25 13:58:39 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL356948: [LLVM-C] Add binding to look up intrinsic by name (authored by CodaFi, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D59697?vs=191878&id=192200#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59697/new/

https://reviews.llvm.org/D59697

Files:
  llvm/trunk/include/llvm-c/Core.h
  llvm/trunk/lib/IR/Core.cpp


Index: llvm/trunk/lib/IR/Core.cpp
===================================================================
--- llvm/trunk/lib/IR/Core.cpp
+++ llvm/trunk/lib/IR/Core.cpp
@@ -2329,6 +2329,10 @@
   return strdup(Str.c_str());
 }
 
+unsigned LLVMLookupIntrinsicID(const char *Name, size_t NameLen) {
+  return Function::lookupIntrinsicID({Name, NameLen});
+}
+
 LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID) {
   auto IID = llvm_map_to_intrinsic_id(ID);
   return llvm::Intrinsic::isOverloaded(IID);
Index: llvm/trunk/include/llvm-c/Core.h
===================================================================
--- llvm/trunk/include/llvm-c/Core.h
+++ llvm/trunk/include/llvm-c/Core.h
@@ -2403,6 +2403,13 @@
 void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn);
 
 /**
+ * Obtain the intrinsic ID number which matches the given function name.
+ *
+ * @see llvm::Function::lookupIntrinsicID()
+ */
+unsigned LLVMLookupIntrinsicID(const char *Name, size_t NameLen);
+
+/**
  * Obtain the ID number from a function instance.
  *
  * @see llvm::Function::getIntrinsicID()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59697.192200.patch
Type: text/x-patch
Size: 1077 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190325/572edae3/attachment.bin>


More information about the llvm-commits mailing list