summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPMacroExpansion.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-26 04:33:10 +0000
committerChris Lattner <sabre@nondot.org>2009-01-26 04:33:10 +0000
commitad13cf4e7a3ca27f2303156ee15c6eb06430cbde (patch)
tree76a1f0a924580e992613e0579f44a9963f742b86 /clang/lib/Lex/PPMacroExpansion.cpp
parent5a5d67101b71577a89a1a3ee89f1b85994d83304 (diff)
downloadbcm5719-llvm-ad13cf4e7a3ca27f2303156ee15c6eb06430cbde.tar.gz
bcm5719-llvm-ad13cf4e7a3ca27f2303156ee15c6eb06430cbde.zip
eagerly resolve the spelling locations of macro argument preexpansions.
This reduces fsyntax-only time on c99-intconst-1.c from 2.43s down to 2.01s (20%), reducing the number of fileid lookups from 2529040 linear and 64771121 binary to 5625902 linear and 4151182 binary. This knocks getFileID down to only 4.6% of compile time on this testcase. At this point, malloc/free is over 35% of compile time, primarily allocating MacroArgs objects and their argument preexpansion vectors. I don't feel like malloc avoiding right now, so I'm just going to call this good. llvm-svn: 62994
Diffstat (limited to 'clang/lib/Lex/PPMacroExpansion.cpp')
-rw-r--r--clang/lib/Lex/PPMacroExpansion.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp
index 518c84e8c38..b14df735ad1 100644
--- a/clang/lib/Lex/PPMacroExpansion.cpp
+++ b/clang/lib/Lex/PPMacroExpansion.cpp
@@ -359,7 +359,7 @@ MacroArgs *Preprocessor::ReadFunctionLikeMacroArgs(Token &MacroName,
Token EOFTok;
EOFTok.startToken();
EOFTok.setKind(tok::eof);
- EOFTok.setLocation(Tok.getLocation());
+ EOFTok.setLocation(SourceMgr.getSpellingLoc(Tok.getLocation()));
EOFTok.setLength(0);
ArgTokens.push_back(EOFTok);
++NumActuals;
OpenPOWER on IntegriCloud