diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-26 20:24:53 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-26 20:24:53 +0000 |
commit | e7689886d6a68507ae90ca330bd24bf89d4d6df1 (patch) | |
tree | 6a42960ea029751f41f5c18c7a1f3299863448bc /lib/Lex/PPDirectives.cpp | |
parent | 071831dcc7fb502d8957535366baa6ac7f72e70d (diff) |
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
Diffstat (limited to 'lib/Lex/PPDirectives.cpp')
-rw-r--r-- | lib/Lex/PPDirectives.cpp | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp index 099dfb4aef..4bf012c1b1 100644 --- a/lib/Lex/PPDirectives.cpp +++ b/lib/Lex/PPDirectives.cpp @@ -1206,12 +1206,6 @@ void Preprocessor::HandleDefineDirective(Token &DefineTok) { if (MI->isObjectLike()) { // Object-like macros are very simple, just read their body. while (Tok.isNot(tok::eom)) { - // If this token has a virtual 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())); - MI->AddTokenToBody(Tok); // Get the next token of the macro. LexUnexpandedToken(Tok); @@ -1221,12 +1215,6 @@ void Preprocessor::HandleDefineDirective(Token &DefineTok) { // Otherwise, read the body of a function-like macro. This has to validate // the # (stringize) operator. while (Tok.isNot(tok::eom)) { - // If this token has a virtual 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())); - MI->AddTokenToBody(Tok); // Check C99 6.10.3.2p1: ensure that # operators are followed by macro |