diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-05-02 15:16:13 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-05-02 15:16:13 +0000 |
commit | 184be849fc5d9da9f353fed4b0d5202b003d16d6 (patch) | |
tree | 0c265dd16a0e1346197eaee9ad930a827a7a9a04 | |
parent | 769aa2d46fa5dc0bee5285c95a80ad8749cb79cf (diff) |
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
-rw-r--r-- | include/clang/Basic/Attr.td | 4 | ||||
-rw-r--r-- | lib/Sema/AttributeList.cpp | 2 |
2 files changed, 2 insertions, 4 deletions
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<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) |