summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PTHLexer.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* PTH: Added minor 'sibling jumping' optimization for iterating over the side ↵Ted Kremenek2008-12-121-9/+37
| | | | | | table used for fast preprocessor block skipping. This has a minor performance improvement when preprocessing Cocoa.h, but can have some wins in pathologic cases. llvm-svn: 60966
* Added PTH optimization to not process entire blocks of tokens that appear in ↵Ted Kremenek2008-12-121-13/+98
| | | | | | skipped preprocessor blocks. This improves PTH speed by 6%. The code for this optimization itself is not very optimized, and will get cleaned up. llvm-svn: 60956
* PTH:Ted Kremenek2008-12-111-12/+18
| | | | | | | - Added a side-table per each token-cached file with the preprocessor conditional stack. This tracks what #if's are matched with what #endifs and where their respective tokens are in the PTH file. This will allow for quick skipping of excluded conditional branches in the Preprocessor. - Performance testing shows the addition of this information (without actually utilizing it) leads to no performance regressions. llvm-svn: 60911
* PTHLexer: Keep track of the location of the last '#' token and provide the ↵Ted Kremenek2008-12-111-6/+9
| | | | | | means to jump ahead in the token stream. llvm-svn: 60905
* Remove unused ivar CurTokenIdx.Ted Kremenek2008-12-111-1/+1
| | | | llvm-svn: 60896
* Declare PerIDCache as IdentifierInfo** instead of void*. This is just ↵Ted Kremenek2008-12-101-2/+2
| | | | | | cleaner. No performance change. llvm-svn: 60843
* Remove unneeded assertion.Ted Kremenek2008-12-041-1/+1
| | | | llvm-svn: 60559
* Use 'free' to release PerIDCache since it was allocated using calloc().Ted Kremenek2008-12-041-1/+1
| | | | llvm-svn: 60556
* PTH:Ted Kremenek2008-12-031-13/+23
| | | | | | Use an array instead of a DenseMap to cache persistent IDs -> IdentifierInfo*. This leads to a 4% speedup at -fsyntax-only using PTH. llvm-svn: 60452
* - Remove PTHManager.cpp. Move all of its functions to PTHLexer.cpp since ↵Ted Kremenek2008-12-031-7/+241
| | | | | | | | some of the internal methods are used by PTHLexer (their implementations are intertwined.) This enables some important inlining opportunities at -O3. - Don't construct an std::vector<Token> prior to feeding PTH tokens to the Preprocessor. Stream them off the PTH file directly. llvm-svn: 60447
* PTHLexer now owns the Token vector.Ted Kremenek2008-11-271-11/+4
| | | | llvm-svn: 60136
* In PTHLexer::DiscardToEndOfLine() use Lex() instead of AdvanceToken(). This ↵Ted Kremenek2008-11-211-1/+2
| | | | | | handles transitions in the preprocessor state. llvm-svn: 59845
* PTHLexer:Ted Kremenek2008-11-211-14/+26
| | | | | | - Move out logic for handling the end-of-file to LexEndOfFile (to match the Lexer) class. The logic now mirrors the Lexer class more, which allows us to pass most of the Preprocessor test cases. llvm-svn: 59768
* PTHLexer:Ted Kremenek2008-11-201-0/+12
| | | | | | | - Move PTHLexer::GetToken() to be inside PTHLexer.cpp. - When lexing in raw mode, null out identifiers. llvm-svn: 59744
* PTHLexer:Ted Kremenek2008-11-201-19/+11
| | | | | | | | | | - Rename 'CurToken' and 'LastToken' to 'CurTokenIdx' and 'LastTokenIdx' respectively. - Add helper methods GetToken(), AdvanceToken(), AtLastToken() to abstract away details of the token stream. This also allows us to easily replace their implementation later. llvm-svn: 59733
* Rewrote PTHLexer::Lex by digging through the sources of Lexer again. Now we ↵Ted Kremenek2008-11-201-28/+37
| | | | | | can do basic macro expansion using the PTHLexer. llvm-svn: 59724
* - Default initialize ParsingPreprocessorDirective, ParsingFilename, andTed Kremenek2008-11-201-15/+12
| | | | | | | | LexingRawMode in the ctor of PreprocessorLexer. - PTHLexer: Use "LastToken" instead of "NumToken" llvm-svn: 59690
* Add (untested) implementation of PTHLexer::isNextPPTokenLParen() and ↵Ted Kremenek2008-11-201-4/+14
| | | | | | PTHLexer::DiscardToEndOfLine(). llvm-svn: 59687
* Add stub for PTHLexer::isNextPPTokenLParen().Ted Kremenek2008-11-191-1/+6
| | | | llvm-svn: 59670
* When using a PTHLexer, use DiscardToEndOfLine() instead of ReadToEndOfLine().Ted Kremenek2008-11-191-0/+7
| | | | llvm-svn: 59668
* - Move static function IsNonPragmaNonMacroLexer into Preprocessor.h.Ted Kremenek2008-11-191-2/+2
| | | | | | | | | | | | | - Add variants of IsNonPragmaNonMacroLexer to accept an IncludeMacroStack entry (simplifies some uses). - Use IsNonPragmaNonMacroLexer in Preprocessor::LookupFile. - Add 'FileID' to PreprocessorLexer, and have Preprocessor query this fileid when looking up the FileEntry for a file Performance testing of -Eonly on Cocoa.h shows no performance regression because of this patch. llvm-svn: 59666
* Trivial tidyingChris Lattner2008-11-161-2/+0
| | | | llvm-svn: 59424
* Move some diagnostic handling to PreprocessorLexer.Ted Kremenek2008-11-121-4/+5
| | | | llvm-svn: 59191
* Add skeleton for PTH lexer.Ted Kremenek2008-11-121-0/+79
llvm-svn: 59169
OpenPOWER on IntegriCloud