Avoid calling getSpelling at all for identifiers, which are
trivial to handle and very very common. This speeds up -E on 447.dealII by 2.5% llvm-svn: 40422
This commit is contained in:
parent
4418ce1091
commit
0af9823e4d
|
@ -517,7 +517,11 @@ void clang::DoPrintPreprocessedInput(unsigned MainFileID, Preprocessor &PP,
|
|||
OutputChar(' ');
|
||||
}
|
||||
|
||||
if (Tok.getLength() < 256) {
|
||||
if (IdentifierInfo *II = Tok.getIdentifierInfo()) {
|
||||
const char *Str = II->getName();
|
||||
unsigned Len = Tok.needsCleaning() ? strlen(Str) : Tok.getLength();
|
||||
OutputString(Str, Len);
|
||||
} else if (Tok.getLength() < 256) {
|
||||
const char *TokPtr = Buffer;
|
||||
unsigned Len = PP.getSpelling(Tok, TokPtr);
|
||||
OutputString(TokPtr, Len);
|
||||
|
|
Loading…
Reference in New Issue