diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-01-13 23:19:12 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-01-13 23:19:12 +0000 |
commit | e9814186acadb40f74e5f59adbcf8a3ca4cc22d0 (patch) | |
tree | 59256cc7b1704191a8afdf6da5f5cf514a90af70 /clang/lib/Lex/PTHLexer.cpp | |
parent | 2b136fe2a5c86df3f8b019ab5df7575f5223fdba (diff) | |
download | bcm5719-llvm-e9814186acadb40f74e5f59adbcf8a3ca4cc22d0.tar.gz bcm5719-llvm-e9814186acadb40f74e5f59adbcf8a3ca4cc22d0.zip |
PTH:
- Use canonical FileID when using getSpelling() caching. This
addresses some cache misses we were seeing with -fsyntax-only on
Cocoa.h
- Added Preprocessor::getPhysicalCharacterAt() utility method for
clients to grab the first character at a specified sourcelocation.
This uses the PTH spelling cache.
- Modified Sema::ActOnNumericConstant() to use
Preprocessor::getPhysicalCharacterAt() instead of
SourceManager::getCharacterData() (to get PTH hits).
These changes cause -fsyntax-only to not page in any sources from
Cocoa.h. We see a speedup of 27%.
llvm-svn: 62193
Diffstat (limited to 'clang/lib/Lex/PTHLexer.cpp')
-rw-r--r-- | clang/lib/Lex/PTHLexer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Lex/PTHLexer.cpp b/clang/lib/Lex/PTHLexer.cpp index c5fc6f3da79..8d04736ced8 100644 --- a/clang/lib/Lex/PTHLexer.cpp +++ b/clang/lib/Lex/PTHLexer.cpp @@ -423,7 +423,7 @@ unsigned PTHSpellingSearch::getSpellingBinarySearch(unsigned fpos, unsigned PTHLexer::getSpelling(SourceLocation sloc, const char *&Buffer) { SourceManager& SM = PP->getSourceManager(); sloc = SM.getPhysicalLoc(sloc); - unsigned fid = sloc.getFileID(); + unsigned fid = SM.getCanonicalFileID(sloc); unsigned fpos = SM.getFullFilePos(sloc); return (fid == FileID ) ? MySpellingSrch.getSpellingLinearSearch(fpos, Buffer) |