without having to get the whole token. This speeds up -E on
447.dealII by 1.8%
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40420
91177308-0d34-0410-b5e6-
96231b3b80d8
if (IdentifierInfo *II = Tok.getIdentifierInfo()) {
// Avoid spelling identifiers, the most common form of token.
FirstChar = II->getName()[0];
+ } else if (!Tok.needsCleaning()) {
+ SourceManager &SrcMgr = PP.getSourceManager();
+ FirstChar =
+ *SrcMgr.getCharacterData(SrcMgr.getPhysicalLoc(Tok.getLocation()));
} else if (Tok.getLength() < 256) {
const char *TokPtr = Buffer;
PP.getSpelling(Tok, TokPtr);