summaryrefslogtreecommitdiff
path: root/include/llvm-c/Core.h
diff options
context:
space:
mode:
authorAmaury Sechet <deadalnix@gmail.com>2016-04-20 01:02:12 +0000
committerAmaury Sechet <deadalnix@gmail.com>2016-04-20 01:02:12 +0000
commit7b1322cacb891b3c07cd4418a8edcc76764384ee (patch)
tree9904e87a7e928d642207898cb2c8e1dc718dde5f /include/llvm-c/Core.h
parent2c4347378675a6a17d2dbbb60f3b44820eced3ee (diff)
Add LLVMGetAttrKindID in the C API in order to facilitate migration away from LLVMAttribute
Summary: LLVMAttribute has outlived its utility and is becoming a problem for C API users that what to use all the LLVM attributes. In order to help moving away from LLVMAttribute in a smooth manner, this diff introduce LLVMGetAttrKindIDInContext, which can be used instead of the enum values. See D18749 for reference. Reviewers: Wallbraker, whitequark, joker.eph, echristo, rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19081 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266842 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm-c/Core.h')
-rw-r--r--include/llvm-c/Core.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h
index d9b6712ac27..0c3d76d6f9b 100644
--- a/include/llvm-c/Core.h
+++ b/include/llvm-c/Core.h
@@ -477,6 +477,19 @@ unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name,
unsigned LLVMGetMDKindID(const char *Name, unsigned SLen);
/**
+ * Return an unique id given the name of a target independent attribute,
+ * or 0 if no attribute by that name exists.
+ *
+ * See http://llvm.org/docs/LangRef.html#parameter-attributes
+ * and http://llvm.org/docs/LangRef.html#function-attributes
+ * for the list of available attributes.
+ *
+ * NB: Attribute names and/or id are subject to change without
+ * going through the C API deprecation cycle.
+ */
+unsigned LLVMGetAttrKindID(const char *Name, size_t SLen);
+
+/**
* @}
*/