r178699 - [preprocessor] Minor optimization following r178671.
Argyrios Kyrtzidis
akyrtzi at gmail.com
Wed Apr 3 14:29:07 PDT 2013
Author: akirtzidis
Date: Wed Apr 3 16:29:07 2013
New Revision: 178699
URL: http://llvm.org/viewvc/llvm-project?rev=178699&view=rev
Log:
[preprocessor] Minor optimization following r178671.
Don't bother looking for parameter index of 'B' token if 'A' is not a parameter.
Modified:
cfe/trunk/lib/Lex/MacroInfo.cpp
Modified: cfe/trunk/lib/Lex/MacroInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/MacroInfo.cpp?rev=178699&r1=178698&r2=178699&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/MacroInfo.cpp (original)
+++ cfe/trunk/lib/Lex/MacroInfo.cpp Wed Apr 3 16:29:07 2013
@@ -110,8 +110,9 @@ bool MacroInfo::isIdenticalTo(const Macr
// 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;
}
More information about the cfe-commits
mailing list