summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPDirectives.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* this massive patch introduces a simple new abstraction: it makesChris Lattner2009-01-171-6/+6
| | | | | | | | | | | | | | | "FileID" a concept that is now enforced by the compiler's type checker instead of yet-another-random-unsigned floating around. This is an important distinction from the "FileID" currently tracked by SourceLocation. *That* FileID may refer to the start of a file or to a chunk within it. The new FileID *only* refers to the file (and its #include stack and eventually #line data), it cannot refer to a chunk. FileID is a completely opaque datatype to all clients, only SourceManager is allowed to poke and prod it. llvm-svn: 62407
* As a performance optimization, don't bother calling MacroInfo::isIdenticalTo Chris Lattner2009-01-161-9/+16
| | | | | | | | if warnings in system headers are disabled. isIdenticalTo can end up calling the expensive getSpelling method, and other bad stuff and is completely unneeded if the warning will be discarded anyway. rdar://6502956 llvm-svn: 62347
* PTH:Ted Kremenek2008-12-231-0/+7
| | | | | | | | | | | | - Embed 'eom' tokens in PTH file. - Use embedded 'eom' tokens to not lazily generate them in the PTHLexer. This means that PTHLexer can always advance to the next token after reading a token (instead of buffering tokens using a copy). - Moved logic of 'ReadToken' into Lex. GetToken & ReadToken no longer exist. - These changes result in a 3.3% speedup (-Eonly) on Cocoa.h. - The code is a little gross. Many cleanups are possible and should be done. llvm-svn: 61360
* Preprocessor: Allocate MacroInfo objects using a BumpPtrAllocator instead ↵Ted Kremenek2008-12-151-7/+19
| | | | | | using new/delete. This speeds up -Eonly on Cocoa.h using the regular lexer by 1.8% and the PTHLexer by 3%. llvm-svn: 61042
* eliminate the isCXXNamedOperator function and some string compares andChris Lattner2008-12-131-8/+2
| | | | | | use identifierinfo instead. Patch by Chris Goller! llvm-svn: 60992
* Added PTH optimization to not process entire blocks of tokens that appear in ↵Ted Kremenek2008-12-121-0/+78
| | | | | | 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
* Convert IdentifierInfo's to be printed the same as DeclarationNames Chris Lattner2008-11-231-1/+1
| | | | | | | | | | | | | | | | | | | | | with implicit quotes around them. This has a bunch of follow-on effects and requires tweaking to a whole lot of code. This causes a regression in two tests (xfailed) by causing it to emit things like: Line 10: duplicate interface declaration for category 'MyClass1' ('Category1') instead of: Line 10: duplicate interface declaration for category 'MyClass1(Category1)' I will fix this in a follow-up commit. As part of this, I had to start switching stuff to use ->getDeclName() instead of Decl::getName() for consistency. This is good, but I was planning to do this as an independent patch. There will be several follow-on patches to clean up some of the mess, but this patch is already too big. llvm-svn: 59917
* Rename IsNonPragmaNonMacroLexer to IsFileLexer.Ted Kremenek2008-11-201-2/+2
| | | | llvm-svn: 59731
* Use PreprocessorLexer::getFileID() instead of Lexer::getFileLoc(). This is ↵Ted Kremenek2008-11-191-1/+1
| | | | | | an intermediate step to having getCurrentLexer() return a PreprocessorLexer* instead of a Lexer*. llvm-svn: 59672
* When using a PTHLexer, use DiscardToEndOfLine() instead of ReadToEndOfLine().Ted Kremenek2008-11-191-4/+9
| | | | llvm-svn: 59668
* - Move static function IsNonPragmaNonMacroLexer into Preprocessor.h.Ted Kremenek2008-11-191-6/+6
| | | | | | | | | | | | | - 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
* don't turn identifierinfo's into strings in diagnostics.Chris Lattner2008-11-191-2/+2
| | | | llvm-svn: 59602
* Revert 59574 (caused tests to fail).Ted Kremenek2008-11-191-2/+2
| | | | llvm-svn: 59579
* - 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. Performance testing of -Eonly on Cocoa.h shows no performance regression because of this patch. llvm-svn: 59574
* Remove the last of the old-style Preprocessor::Diag methods.Chris Lattner2008-11-181-2/+2
| | | | llvm-svn: 59554
* remove one more Preprocessor::Diag method.Chris Lattner2008-11-181-7/+9
| | | | llvm-svn: 59512
* Convert the lexer and start converting the PP over to using canonical Diag ↵Chris Lattner2008-11-181-14/+27
| | | | | | methods. llvm-svn: 59511
* Add hooks to use PTHLexer::Lex instead of Lexer::Lex when CurLexer is null.Ted Kremenek2008-11-181-3/+5
| | | | | | | Performance tests on Cocoa.h (using the regular Lexer) shows no performance difference. llvm-svn: 59479
* Added conditional guard 'if (CurLexer)' when using SetCommentRetentionState().Ted Kremenek2008-11-181-6/+6
| | | | | | | | | | | | This is because the PTHLexer will not support this method. Performance testing on preprocessing Cocoa.h shows that this results in a negligible performance difference (less than 1%). I tried making Lexer::SetCommentRetentionState() an out-of-line function (a precursor to making it a virtual function in PreprocessorLexer) and noticed a 1% decrease in speed (it is called in a hot part of the Preprocessor). llvm-svn: 59477
* Change a bunch of uses of 'CurLexer->' to 'CurPPLexer->', which should be theTed Kremenek2008-11-181-40/+40
| | | | | | | | alias for the current PreprocessorLexer. No functionality change. Performance testing shows this results in no performance degradation when preprocessing Cocoa.h. llvm-svn: 59474
* Rename Characteristic_t to CharacteristicKindChris Lattner2008-10-271-1/+1
| | | | llvm-svn: 58224
* Stop the preprocessor from poking the lexer's private parts.Chris Lattner2008-10-121-6/+6
| | | | llvm-svn: 57399
* clean up a bunch of fixme's I added, by moving Chris Lattner2008-09-261-4/+3
| | | | | | DirectoryLookup::DirType into SourceManager.h llvm-svn: 56692
* Fix the rest of rdar://6243860 hopefully. This requires changing FileIDInfoChris Lattner2008-09-261-7/+15
| | | | | | | | | | | 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
* * Remove isInSystemHeader() from DiagClient, move it to SourceManagerNico Weber2008-08-101-1/+2
| | | | | | | | | | | | | | | | * Move FormatError() from TextDiagnostic up to DiagClient, remove now empty class TextDiagnostic * Make DiagClient optional for Diagnostic This fixes the following problems: * -html-diags (and probably others) does now output the same set of warnings as console clang does * nothing crashes if one forgets to call setHeaderSearch() on TextDiagnostic * some code duplication is removed llvm-svn: 54620
* fix PR2357 (#ifs didnt invalidate the multiple-inclusion optimization state)Nuno Lopes2008-06-011-9/+10
| | | | llvm-svn: 51843
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+1153
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