aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCParser/AsmLexer.cpp
diff options
context:
space:
mode:
authorDavid Peixotto <dpeixott@codeaurora.org>2013-12-06 23:05:33 +0000
committerDavid Peixotto <dpeixott@codeaurora.org>2013-12-06 23:05:33 +0000
commit27aa00155898b1bdee2da52a67c49c5bf00e4230 (patch)
tree0f0860ab6b27940bfbcf70d86ff2bd93adc6402c /llvm/lib/MC/MCParser/AsmLexer.cpp
parent9ca8df1e3f11fccfd713dc760ae8155247251760 (diff)
downloadllvm-27aa00155898b1bdee2da52a67c49c5bf00e4230.zip
llvm-27aa00155898b1bdee2da52a67c49c5bf00e4230.tar.gz
llvm-27aa00155898b1bdee2da52a67c49c5bf00e4230.tar.bz2
Cache AllowAtInIdentifier as class variable in AsmLexer
This commit caches the value of the AllowAtInIdentifier variable as a class variable in AsmLexer. We do this to avoid repeated MAI queries and string comparisons each time we lex an identifier. llvm-svn: 196622
Diffstat (limited to 'llvm/lib/MC/MCParser/AsmLexer.cpp')
-rw-r--r--llvm/lib/MC/MCParser/AsmLexer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCParser/AsmLexer.cpp b/llvm/lib/MC/MCParser/AsmLexer.cpp
index a066e64..ed98f93 100644
--- a/llvm/lib/MC/MCParser/AsmLexer.cpp
+++ b/llvm/lib/MC/MCParser/AsmLexer.cpp
@@ -25,6 +25,7 @@ AsmLexer::AsmLexer(const MCAsmInfo &_MAI) : MAI(_MAI) {
CurBuf = NULL;
CurPtr = NULL;
isAtStartOfLine = true;
+ AllowAtInIdentifier = !StringRef(MAI.getCommentString()).startswith("@");
}
AsmLexer::~AsmLexer() {
@@ -144,7 +145,6 @@ static bool IsIdentifierChar(char c, bool AllowAt) {
(c == '@' && AllowAt) || c == '?';
}
AsmToken AsmLexer::LexIdentifier() {
- bool AllowAtInIdentifier = !StringRef(MAI.getCommentString()).startswith("@");
// Check for floating point literals.
if (CurPtr[-1] == '.' && isdigit(*CurPtr)) {
// Disambiguate a .1243foo identifier from a floating literal.