From: Douglas Gregor Date: Wed, 2 May 2012 15:16:13 +0000 (+0000) Subject: Implement the alternate spellings of attributes aligned (as "align") X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=184be849fc5d9da9f353fed4b0d5202b003d16d6;p=clang Implement the alternate spellings of attributes aligned (as "align") 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 --- diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index e8e0f35096..66b50c03a6 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -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 { diff --git a/lib/Sema/AttributeList.cpp b/lib/Sema/AttributeList.cpp index f142ab4c0a..f85fb3d467 100644 --- a/lib/Sema/AttributeList.cpp +++ b/lib/Sema/AttributeList.cpp @@ -108,10 +108,8 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo *Name) { return llvm::StringSwitch(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)