From 000b227286a5c0979e118b6b8a1bd4d62dc58378 Mon Sep 17 00:00:00 2001 From: Amaury Sechet Date: Mon, 23 May 2016 16:38:25 +0000 Subject: [PATCH] Extract renaming from D19181 Summary: This needs to get in before anything is released concerning attribute. If the old name gets in the wild, then we are stuck with it forever. Putting it in its own diff should getting that part at least in fast. Reviewers: Wallbraker, whitequark, joker.eph, echristo, rafael, jyknight Subscribers: llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D20417 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270452 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/ReleaseNotes.rst | 2 +- include/llvm-c/Core.h | 2 +- lib/IR/Core.cpp | 9 ++------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/docs/ReleaseNotes.rst b/docs/ReleaseNotes.rst index 1f88ec1048d..47dde2fc858 100644 --- a/docs/ReleaseNotes.rst +++ b/docs/ReleaseNotes.rst @@ -55,7 +55,7 @@ Non-comprehensive list of changes in this release in favor of LLVMGetDataLayoutStr. * The C API enum LLVMAttribute is deprecated in favor of - LLVMGetAttrKindID. + LLVMGetAttributeKindForName. * ``TargetFrameLowering::eliminateCallFramePseudoInstr`` now returns an iterator to the next instruction instead of ``void``. Targets that previously diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h index 7ec8b8cffff..674b93ffd5f 100644 --- a/include/llvm-c/Core.h +++ b/include/llvm-c/Core.h @@ -487,7 +487,7 @@ unsigned LLVMGetMDKindID(const char *Name, unsigned SLen); * 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); +unsigned LLVMGetAttributeKindForName(const char *Name, size_t SLen); /** * @} diff --git a/lib/IR/Core.cpp b/lib/IR/Core.cpp index 0c6c6f5157d..8429ef1a5e0 100644 --- a/lib/IR/Core.cpp +++ b/lib/IR/Core.cpp @@ -124,13 +124,8 @@ unsigned LLVMGetMDKindID(const char *Name, unsigned SLen) { #define GET_ATTR_KIND_FROM_NAME #include "AttributesCompatFunc.inc" -unsigned LLVMGetAttrKindID(const char *Name, size_t SLen) { - auto K = getAttrKindFromName(StringRef(Name, SLen)); - if (K == Attribute::None) { - return 0; - } - - return AttributeImpl::getAttrMask(K); +unsigned LLVMGetAttributeKindForName(const char *Name, size_t SLen) { + return getAttrKindFromName(StringRef(Name, SLen)); } char *LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI) { -- 2.11.0