]> granicus.if.org Git - clang/commitdiff
Implement the alternate spellings of attributes aligned (as "align")
authorDouglas Gregor <dgregor@apple.com>
Wed, 2 May 2012 15:16:13 +0000 (15:16 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 2 May 2012 15:16:13 +0000 (15:16 +0000)
and const (as "__const") using tblgen, rather than explicitly hacking
them in.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155991 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/Attr.td
lib/Sema/AttributeList.cpp

index e8e0f35096f3ffe4209c6bb197af1f11984d889a..66b50c03a6c8e950009369976ec5f7374dbe5f61 100644 (file)
@@ -118,7 +118,7 @@ def Alias : InheritableAttr {
 }
 
 def Aligned : InheritableAttr {
-  let Spellings = ["aligned"];
+  let Spellings = ["aligned", "align"];
   let Subjects = [NonBitField, NormalVar, Tag];
   let Args = [AlignedArgument<"Alignment">];
   let Namespaces = ["", "std"];
@@ -219,7 +219,7 @@ def Common : InheritableAttr {
 }
 
 def Const : InheritableAttr {
-  let Spellings = ["const"];
+  let Spellings = ["const", "__const"];
 }
 
 def Constructor : InheritableAttr {
index f142ab4c0a324407cc418f26e1de27e2d86dc5b7..f85fb3d467bf33dc01f9d8d69cb80ea195c45396 100644 (file)
@@ -108,10 +108,8 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo *Name) {
   return llvm::StringSwitch<AttributeList::Kind>(AttrName)
     #include "clang/Sema/AttrParsedAttrKinds.inc"
     .Case("address_space", AT_address_space)
-    .Case("align", AT_aligned) // FIXME - should it be "aligned"?
     .Case("base_check", AT_base_check)
     .Case("bounded", IgnoredAttribute)       // OpenBSD
-    .Case("__const", AT_const) // some GCC headers do contain this spelling
     .Case("cf_returns_autoreleased", AT_cf_returns_autoreleased)
     .Case("mode", AT_mode)
     .Case("vec_type_hint", IgnoredAttribute)