summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2013-12-06 16:26:55 +0000
committerAaron Ballman <aaron@aaronballman.com>2013-12-06 16:26:55 +0000
commit9e264854120eb1d93b9a86a66f2af38f9ed90645 (patch)
treedaa924c721b66a856ef01b9fa245ba45b078255b
parenta40bef25eebdb0bfc87b054d40048a5072798bac (diff)
downloadbcm5719-llvm-9e264854120eb1d93b9a86a66f2af38f9ed90645.tar.gz
bcm5719-llvm-9e264854120eb1d93b9a86a66f2af38f9ed90645.zip
Tweak the ordering of a conditional to possibly avoid a few strcmps.
llvm-svn: 196584
-rw-r--r--clang/lib/Lex/PPMacroExpansion.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp
index 954abe25d83..49acd2515d6 100644
--- a/clang/lib/Lex/PPMacroExpansion.cpp
+++ b/clang/lib/Lex/PPMacroExpansion.cpp
@@ -1048,7 +1048,7 @@ static bool HasExtension(const Preprocessor &PP, const IdentifierInfo *II) {
static bool HasAttribute(const IdentifierInfo *II) {
StringRef Name = II->getName();
// Normalize the attribute name, __foo__ becomes foo.
- if (Name.startswith("__") && Name.endswith("__") && Name.size() >= 4)
+ if (Name.size() >= 4 && Name.startswith("__") && Name.endswith("__"))
Name = Name.substr(2, Name.size() - 4);
// FIXME: Do we need to handle namespaces here?
OpenPOWER on IntegriCloud