summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPLexerChange.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Reenable the default lexer.Ted Kremenek2008-11-211-1/+1
| | | | llvm-svn: 59843
* When creating the raw tokens for PTHLexer, make sure the token representing ↵Ted Kremenek2008-11-211-1/+4
| | | | | | the file to include is checked for being an identifier. llvm-svn: 59842
* When creating raw tokens for the PTHLexer specially handle angled strings ↵Ted Kremenek2008-11-211-6/+30
| | | | | | for #include directives. llvm-svn: 59840
* Rename IsNonPragmaNonMacroLexer to IsFileLexer.Ted Kremenek2008-11-201-5/+5
| | | | llvm-svn: 59731
* Add ugly "test harness" for PTHLexer that is not enabled by default. TheTed Kremenek2008-11-201-6/+49
| | | | | | | | | | (temporary hack) to test the PTHLexer is that whenever we would create a Lexer object we instead raw lex a memory buffer first and then use the PTHLexer. This logic exists only to driver the PTHLexer and will be removed/changed in the future. Note that the regular path using normal Lexer objects is what is used by default. llvm-svn: 59723
* Make FIXME a hard assertion.Ted Kremenek2008-11-201-2/+6
| | | | llvm-svn: 59695
* Preprocessor::getCurrentFileLexer() now returns a PreprocessorLexer* instead ofTed Kremenek2008-11-201-5/+6
| | | | | | | a Lexer*. This means it will either return the current (normal) file Lexer or a PTHLexer. llvm-svn: 59694
* Move more cases of using 'CurLexer' to 'CurPPLexer'.Ted Kremenek2008-11-191-26/+35
| | | | | | Use PTHLexer::isNextPPTokenLParen() when using the PTHLexer. llvm-svn: 59671
* - Move static function IsNonPragmaNonMacroLexer into Preprocessor.h.Ted Kremenek2008-11-191-14/+5
| | | | | | | | | | | | | - 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
* Revert 59574 (caused tests to fail).Ted Kremenek2008-11-191-5/+14
| | | | llvm-svn: 59579
* - Move static function IsNonPragmaNonMacroLexer into Preprocessor.h.Ted Kremenek2008-11-191-14/+5
| | | | | | | | | | | - Add variants of IsNonPragmaNonMacroLexer to accept an IncludeMacroStack entry (simplifies some uses). - Use IsNonPragmaNonMacroLexer in Preprocessor::LookupFile. Performance testing of -Eonly on Cocoa.h shows no performance regression because of this patch. llvm-svn: 59574
* - Add Lexer::isPragma() accessor for clients of Lexer that aren't friends.Ted Kremenek2008-11-181-8/+14
| | | | | | | | | - Add static method to test if the current lexer is a non-macro/non-pragma lexer. - Refactor some code in PPLexerChange to use this static method. - No performance change. llvm-svn: 59486
* - Add 'CurPPLexer' to Preprocessor to keep track of the currentTed Kremenek2008-11-181-0/+1
| | | | | | | | | PreprocessorLexer, which will either be a 'Lexer' or 'PTHLexer'. - Added stub field 'CurPTHLexer' to keep track of the current PTHLexer. - Modified IncludeStackInfo to track both the current PTHLexer and current PreprocessorLexer. llvm-svn: 59472
* Using llvm::OwningPtr<> for CurLexer and CurTokenLexer. This makes both the ↵Ted Kremenek2008-11-131-15/+13
| | | | | | ownership semantics of these objects explicit within the Preprocessor and also tightens up the code (explicit deletes not needed). llvm-svn: 59249
* Use PushIncludeMacroStack/PopMacroStack instead of manually pushing/popping ↵Ted Kremenek2008-11-131-14/+6
| | | | | | from IncludeMacroStack. This is both cleaner and makes the include stack transparently extensible. llvm-svn: 59248
* Rename Characteristic_t to CharacteristicKindChris Lattner2008-10-271-2/+2
| | | | llvm-svn: 58224
* Change FormTokenWithChars to take the token kind to form, since all clientsChris Lattner2008-10-121-2/+1
| | | | | | | were setting a kind and then forming it. This is just a minor API cleanup, no functionality change. llvm-svn: 57404
* clean up a bunch of fixme's I added, by moving Chris Lattner2008-09-261-8/+4
| | | | | | DirectoryLookup::DirType into SourceManager.h llvm-svn: 56692
* Fix the rest of rdar://6243860 hopefully. This requires changing FileIDInfoChris Lattner2008-09-261-13/+9
| | | | | | | | | | | to whether the fileid is a 'extern c system header' in addition to whether it is a system header, most of this is spreading plumbing around. Once we have that, PPLexerChange bases its "file enter/exit" notifications to PPCallbacks to base the system header state on FileIDInfo instead of HeaderSearch. Finally, in Preprocessor::HandleIncludeDirective, mirror logic in GCC: the system headerness of a file being entered can be set due to the #includer or the #includee. llvm-svn: 56688
* More #include cleaningDaniel Dunbar2008-08-111-1/+0
| | | | | | | | | | | - Kill unnecessary #includes in .cpp files. This is an automatic sweep so some things removed are actually used, but happen to be included by a previous header. I tried to get rid of the obvious examples and this was the easiest way to trim the #includes in one fell swoop. - We now return to regularly scheduled development. llvm-svn: 54632
* Allow the preprocessor to cache the lexed tokens, so that we can do ↵Argyrios Kyrtzidis2008-08-101-88/+0
| | | | | | | | | | | | | | | efficient lookahead and backtracking. 1) New public methods added: -EnableBacktrackAtThisPos -DisableBacktrack -Backtrack -isBacktrackEnabled 2) LookAhead() implementation is replaced with a more efficient one. 3) LookNext() is removed. llvm-svn: 54611
* Convert CRLF -> LF line endings.Argyrios Kyrtzidis2008-07-121-21/+21
| | | | llvm-svn: 53519
* Add Preprocessor::LookNext method, which implements an efficient way to ↵Argyrios Kyrtzidis2008-07-091-0/+26
| | | | | | 'take a peek' at the next token without consuming it. llvm-svn: 53375
* Avoid overflowing buffer, patch by Algeris Kirtzidis!Chris Lattner2008-03-241-1/+1
| | | | llvm-svn: 48741
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+401
lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
OpenPOWER on IntegriCloud