From 60b31453ac9cc8f8c1f484d6e16ae987b7059c0c Mon Sep 17 00:00:00 2001 From: Amaury Sechet Date: Wed, 20 Apr 2016 01:02:12 +0000 Subject: 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 llvm-svn: 266842 --- llvm/include/llvm-c/Core.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'llvm/include/llvm-c') diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h index d9b6712ac27..0c3d76d6f9b 100644 --- a/llvm/include/llvm-c/Core.h +++ b/llvm/include/llvm-c/Core.h @@ -476,6 +476,19 @@ unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name, unsigned SLen); 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); + /** * @} */ -- cgit v1.2.3