aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/AttributeList.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-05-02 17:33:51 +0000
committerDouglas Gregor <dgregor@apple.com>2012-05-02 17:33:51 +0000
commit0c19b3c38e356058aeb2424d175eae232bf014d9 (patch)
tree3cb9eee9e8f7eaf1669a6382f37eca7a423a8f69 /lib/Sema/AttributeList.cpp
parent331d2ec7cd4c6b5e29cc61fcdc617bf708223cd4 (diff)
Replace the StringSwitch in AttributeList::getKind() with a
TableGen-generated StringMatcher, for a 1.2% speedup in -fparse-only time in <rdar://problem/11004361>. Thanks to Benjamin for pointing me at StringMatcher! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156003 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/AttributeList.cpp')
-rw-r--r--lib/Sema/AttributeList.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Sema/AttributeList.cpp b/lib/Sema/AttributeList.cpp
index cbd2ba4194..101e0384fa 100644
--- a/lib/Sema/AttributeList.cpp
+++ b/lib/Sema/AttributeList.cpp
@@ -97,6 +97,8 @@ AttributePool::createIntegerAttribute(ASTContext &C, IdentifierInfo *Name,
return create(Name, TokLoc, 0, TokLoc, 0, TokLoc, &IArg, 1, 0);
}
+#include "clang/Sema/AttrParsedAttrKinds.inc"
+
AttributeList::Kind AttributeList::getKind(const IdentifierInfo *Name) {
StringRef AttrName = Name->getName();
@@ -105,7 +107,5 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo *Name) {
AttrName.size() >= 4)
AttrName = AttrName.substr(2, AttrName.size() - 4);
- return llvm::StringSwitch<AttributeList::Kind>(AttrName)
- #include "clang/Sema/AttrParsedAttrKinds.inc"
- .Default(UnknownAttribute);
+ return ::getAttrKind(AttrName);
}