remove my hacks that aggressively threw away multiple
instantiation history in an effort to speed up c99-intconst-1.c.
Now that multiple nested instantiations are allowed, we just
make them and don't pay the cost of lookups. With the other
changes that went in before this, reverting this is actually
a speedup for c99-intconst-1.c, speeding it up from 1.96s to 1.80s,
and preserves much better loc info.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63036 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp
index b3e921c..8eada60 100644
--- a/lib/Lex/PPMacroExpansion.cpp
+++ b/lib/Lex/PPMacroExpansion.cpp
@@ -340,13 +340,6 @@
if (!MI->isEnabled())
Tok.setFlag(Token::DisableExpand);
}
-
- // If this token has instantiation location, resolve it down to its
- // spelling location. This is not strictly needed, but avoids extra
- // resolutions for macros that are expanded frequently.
- if (!Tok.getLocation().isFileID())
- Tok.setLocation(SourceMgr.getSpellingLoc(Tok.getLocation()));
-
ArgTokens.push_back(Tok);
}
@@ -359,7 +352,7 @@
Token EOFTok;
EOFTok.startToken();
EOFTok.setKind(tok::eof);
- EOFTok.setLocation(SourceMgr.getSpellingLoc(Tok.getLocation()));
+ EOFTok.setLocation(Tok.getLocation());
EOFTok.setLength(0);
ArgTokens.push_back(EOFTok);
++NumActuals;