[PATCH] D20417: Extract renaming from D19181

Amaury SECHET via llvm-commits llvm-commits at lists.llvm.org
Thu May 19 01:02:31 PDT 2016


deadalnix created this revision.
deadalnix added reviewers: Wallbraker, whitequark, joker.eph, echristo, rafael, jyknight.
deadalnix added a subscriber: llvm-commits.
Herald added a subscriber: joker.eph.

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.

http://reviews.llvm.org/D20417

Files:
  docs/ReleaseNotes.rst
  include/llvm-c/Core.h
  lib/IR/Core.cpp

Index: lib/IR/Core.cpp
===================================================================
--- lib/IR/Core.cpp
+++ lib/IR/Core.cpp
@@ -124,13 +124,8 @@
 #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) {
Index: include/llvm-c/Core.h
===================================================================
--- include/llvm-c/Core.h
+++ include/llvm-c/Core.h
@@ -487,7 +487,7 @@
  * 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);
 
 /**
  * @}
Index: docs/ReleaseNotes.rst
===================================================================
--- docs/ReleaseNotes.rst
+++ docs/ReleaseNotes.rst
@@ -55,7 +55,7 @@
   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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20417.57743.patch
Type: text/x-patch
Size: 1530 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160519/0bd199b4/attachment.bin>


More information about the llvm-commits mailing list