[preprocessor] Minor optimization following r178671.

Don't bother looking for parameter index of 'B' token if 'A' is not a parameter.

llvm-svn: 178699
This commit is contained in:
Argyrios Kyrtzidis 2013-04-03 21:29:07 +00:00
parent c70fca60da
commit f0eaa64c98
1 changed files with 3 additions and 2 deletions

View File

@ -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;
}