aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-04-03 21:29:07 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-04-03 21:29:07 +0000
commit4ad33d0f971da3eba5041f13fbd034f80ea9bfeb (patch)
treec2c709143ccaacf7fc79940afe96b7cd1b1d9b03 /lib
parent78037ac3e7562aa3e306eaba97f1c609b86337d9 (diff)
[preprocessor] Minor optimization following r178671.
Don't bother looking for parameter index of 'B' token if 'A' is not a parameter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178699 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Lex/MacroInfo.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Lex/MacroInfo.cpp b/lib/Lex/MacroInfo.cpp
index 5abafe1cb7..b61ff71d17 100644
--- a/lib/Lex/MacroInfo.cpp
+++ b/lib/Lex/MacroInfo.cpp
@@ -110,8 +110,9 @@ bool MacroInfo::isIdenticalTo(const MacroInfo &Other, Preprocessor &PP,
// With syntactic equivalence the parameter names can be different as long
// as they are used in the same place.
int AArgNum = getArgumentNum(A.getIdentifierInfo());
- int BArgNum = Other.getArgumentNum(B.getIdentifierInfo());
- if (AArgNum == -1 || AArgNum != BArgNum)
+ if (AArgNum == -1)
+ return false;
+ if (AArgNum != Other.getArgumentNum(B.getIdentifierInfo()))
return false;
continue;
}