[cfe-commits] r155991 - in /cfe/trunk: include/clang/Basic/Attr.td lib/Sema/AttributeList.cpp

Douglas Gregor dgregor at apple.com
Wed May 2 08:16:13 PDT 2012


Author: dgregor
Date: Wed May  2 10:16:13 2012
New Revision: 155991

URL: http://llvm.org/viewvc/llvm-project?rev=155991&view=rev
Log:
Implement the alternate spellings of attributes aligned (as "align")
and const (as "__const") using tblgen, rather than explicitly hacking
them in.

Modified:
    cfe/trunk/include/clang/Basic/Attr.td
    cfe/trunk/lib/Sema/AttributeList.cpp

Modified: cfe/trunk/include/clang/Basic/Attr.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=155991&r1=155990&r2=155991&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Attr.td (original)
+++ cfe/trunk/include/clang/Basic/Attr.td Wed May  2 10:16:13 2012
@@ -118,7 +118,7 @@
 }
 
 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 Const : InheritableAttr {
-  let Spellings = ["const"];
+  let Spellings = ["const", "__const"];
 }
 
 def Constructor : InheritableAttr {

Modified: cfe/trunk/lib/Sema/AttributeList.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AttributeList.cpp?rev=155991&r1=155990&r2=155991&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/AttributeList.cpp (original)
+++ cfe/trunk/lib/Sema/AttributeList.cpp Wed May  2 10:16:13 2012
@@ -108,10 +108,8 @@
   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)





More information about the cfe-commits mailing list