summaryrefslogtreecommitdiffstats
path: root/clang/Lex/Preprocessor.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-560/+0
| | | | | | | | | | 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
* Make the preprocessor own its PPCallbacks, fixing a memory leak.Chris Lattner2008-03-141-0/+2
| | | | | | Patch by Sam Bishop! llvm-svn: 48357
* Move a bunch more code out of Preprocessor.cpp into PPLexerChange.cppChris Lattner2008-03-091-353/+0
| | | | llvm-svn: 48080
* split macro expansion support out of Preprocessor.cpp into PPMacroExpansion.cppChris Lattner2008-03-091-507/+0
| | | | | | | Rename Directives.cpp -> PPDirectives.cpp since it implements part of the Preprocessor class. llvm-svn: 48078
* rename HandleEndOfMacro -> HandleEndOfTokenLexerChris Lattner2008-03-091-4/+4
| | | | llvm-svn: 48076
* split the MacroArgs class out of TokenLexer.cpp/h intoChris Lattner2008-03-091-0/+1
| | | | | | MacroArgs.cpp/h llvm-svn: 48075
* rename some MacroExpander-related ivars to TokenLexer.Chris Lattner2008-03-091-35/+35
| | | | llvm-svn: 48073
* rename the MacroExpander class to TokenLexer. It handles bothChris Lattner2008-03-091-2/+2
| | | | | | token streams and macro lexing, so a more generic name is useful. llvm-svn: 48071
* split preprocesor directive handling out of Preprocessor.cpp into Directives.cppChris Lattner2008-03-091-1083/+0
| | | | llvm-svn: 48068
* Remove the first layer of support for "portability" warnings. This is Chris Lattner2008-03-051-78/+4
| | | | | | | | | | | | | | | theoretically useful, but not useful in practice. It adds a bunch of complexity, and not much value. It's best to nuke it. One big advantage is that it means the target interfaces will soon lose their SLoc arguments and target queries can never emit diagnostics anymore (yay). Removing this also simplifies some of the core preprocessor which should make it slightly faster. Ted, I didn't simplify TripleProcessor, which can now have at most one triple, and can probably just be removed. Please poke at it when you have time. llvm-svn: 47930
* Revert an incorrect part of my previuos patch.Lauro Ramos Venancio2008-02-251-1/+1
| | | | llvm-svn: 47553
* Fix PR2086.Lauro Ramos Venancio2008-02-251-13/+18
| | | | llvm-svn: 47551
* Fix CheckEndOfDirective to diagnose lines that contain macros that expand to Chris Lattner2008-02-161-2/+5
| | | | | | | zero tokens. This fixes PR2045, thanks to Neil for finding another incredibly subtle corner case :) llvm-svn: 47203
* Move Microsoft __declspec hack from the parser to the preprocessor. Since we ↵Steve Naroff2008-02-111-0/+1
| | | | | | have no plans to actually implement this construct, it is cleaner to limit the change to the preprocessor. llvm-svn: 46973
* long is 32-bit is on win32.Chris Lattner2008-02-101-1/+1
| | | | llvm-svn: 46935
* - Add support for fuzzy parsing line-oriented __asm's (yuck).Steve Naroff2008-02-071-0/+1
| | | | | | - Change handling of __w64 to a built-in macro. llvm-svn: 46864
* Minor cleanup from yesterday's -fms-extension commit. Move __int* MS ↵Steve Naroff2008-02-071-0/+4
| | | | | | keywords to predefined macros. This removes some of the MS-madness from Parser::ParseDeclarationSpecifiers(). llvm-svn: 46852
* Implement support for the extremely atrocious MS /##/ extension, Chris Lattner2008-02-071-0/+65
| | | | | | | which pastes together a comment. This is only enabled with -fms-extensions of course. llvm-svn: 46845
* Implement -fms-extensions. This allows us to fuzzy parse non-standard MS ↵Steve Naroff2008-02-071-1/+7
| | | | | | constructs used in "windows.h". llvm-svn: 46838
* Fix PR1969. stdin has no FileEntry.Chris Lattner2008-02-011-8/+9
| | | | llvm-svn: 46629
* Change the location we return for the EOF token to actually be on the lastChris Lattner2008-01-251-2/+18
| | | | | | line of the file, in the common case where a file ends with a newline. llvm-svn: 46335
* Fix PR1936, a crash on malformed #if. Thanks to Neil forChris Lattner2008-01-221-2/+2
| | | | | | noticing this! llvm-svn: 46256
* Change uses of std::cerr/std::cout to llvm::Lcerr/llvm::cout, and removeTed Kremenek2008-01-141-38/+38
| | | | | | | | #include<iostream>. Patch provided by Sam Bishop. llvm-svn: 45962
* Fix a nasty corner case that Neil noticed in PR1900, where we would Chris Lattner2008-01-071-0/+4
| | | | | | | | | | | | incorrectly apply the multiple include optimization to files with guards like: #if !defined(x) MACRO where MACRO could expand to different things in different contexts. Thanks Neil! llvm-svn: 45716
* Fix typoNate Begeman2008-01-071-1/+1
| | | | llvm-svn: 45682
* Don't attribute in file headers anymore. See llvmdev for theChris Lattner2007-12-291-2/+2
| | | | | | discussion of this change. llvm-svn: 45410
* Interned MainFileID within SourceManager. Since SourceManager is referenced byTed Kremenek2007-12-191-1/+4
| | | | | | | | | both Preprocessor and ASTContext, we no longer need to explicitly pass MainFileID around in function calls that also pass either Preprocessor or ASTContext. This resulted in some nice cleanups in the ASTConsumers and the driver. llvm-svn: 45228
* TargetInfo no longer includes a reference to SourceManager.Ted Kremenek2007-12-121-8/+10
| | | | | | | | | | | | | | | Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation. Added many utility methods to FullSourceLoc to provide shorthand for: FullLoc.getManager().someMethod(FullLoc.getLocation()); instead we have: FullLoc.someMethod(); Modified TextDiagnostics (and related classes) to use this short-hand. llvm-svn: 44957
* Mega-patch: ripped SourceManager out of Diagnostic/DiagnosticClient. NowTed Kremenek2007-12-111-2/+2
| | | | | | | | | | | | | | | | | | SourceManager is passed by reference, allowing the SourceManager to be associated with a specific translation unit, and not the entire execution of the driver. Modified all users of Diagnostics to comply with this new interface. Integrated SourceManager as a member variable of TargetInfo. TargetInfo will eventually be associated with a single translation unit (just like SourceManager). Made the SourceManager reference in ASTContext private. Provided accessor getSourceManager() for clients to use instead. Modified clients to comply with new interface. llvm-svn: 44878
* Add dumping support for locations, make -dumptokens print out the locationChris Lattner2007-12-091-1/+20
| | | | | | info of each token. llvm-svn: 44741
* Fix PR1820, an incredibly subtle macro expansion bug that Neil discovered.Chris Lattner2007-11-231-0/+10
| | | | | | Neil, please review this fix. llvm-svn: 44285
* fix a bug Steve noticed, where a #import of the main file itself would fail.Chris Lattner2007-11-151-1/+6
| | | | llvm-svn: 44178
* Since we are all working on Leopard, change the built-in MacOS X version ↵Steve Naroff2007-11-101-1/+1
| | | | | | number (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) to target Leopard. This is only a short term solution, until the clang driver implements the "-mmacosx-version-min" flag (which will compute this value based on the target). llvm-svn: 43981
* Implement a more sensible strategy for ObjC built-in types (addressing a ↵Steve Naroff2007-10-311-27/+1
| | | | | | | | | | | | long standing FIXME in Sema::GetObjcIdType()). This removes several gross hacks to work around the previous "lazy" behavior. Two notes: - MinimalActions still needs to be taught about the built-in types (This breaks one of the -noop test cases). I started this, then added a FIXME. - I didn't convert Sema::GetObjcProtoType() yet. llvm-svn: 43567
* Checking in some code that is still under construction.Steve Naroff2007-10-311-1/+0
| | | | | | I need to (finally) change the way Class/id/SEL/IMP are built-in...the current approach of doing it in the preprocessor is "broken". The other problem is Sema::GetObjcIdType/GetObjcSelType/GetObjcClassType, the hooks that initialize ASTContext lazily. These built-in types need to be done up front... llvm-svn: 43557
* Add some plumbing to help cope with rewriting "id<p>", "Class<p>*".Steve Naroff2007-10-311-1/+1
| | | | llvm-svn: 43543
* Stop pre-defining objc_msgSend/objc_getClass in the preprocessor. Instead, I ↵Steve Naroff2007-10-301-15/+1
| | | | | | generate these declaration on the fly when rewriting a message expression. llvm-svn: 43529
* Avoid using macro expansions, which causes these to come out in -E mode.Chris Lattner2007-10-301-6/+6
| | | | llvm-svn: 43505
* Incorporate some feedback from Chris...Steve Naroff2007-10-241-1/+1
| | | | llvm-svn: 43285
* - Add rewrite rule for @class.Steve Naroff2007-10-231-0/+17
| | | | | | | - Add setter/getter to ObjcClassDecl. - Predefined key runtime functions. llvm-svn: 43257
* Predefine all the ObjC goodies from <objc/objc.h>. Removed all the ObjC ↵Steve Naroff2007-10-171-3/+21
| | | | | | goodies from the respective test files. Moving forward, it will be very nice to assume these builtin! llvm-svn: 43077
* resolve a fixme, by moving __builtin_va_list to a more logicalChris Lattner2007-10-101-0/+6
| | | | | | place and making it correctly parameterized on the target. llvm-svn: 42830
* Add a dummy for the id typedef. Steve, plz fill this in. :)Chris Lattner2007-10-091-0/+7
| | | | llvm-svn: 42819
* Make a significant change to invert the control flow handlingChris Lattner2007-10-091-7/+131
| | | | | | | | | | | | | | | | | | | | | | predefined macros. Previously, these were handled by the driver, now they are handled by the preprocessor. Some fallout of this: 1. Instead of preprocessing two buffers (the predefines, then the main source file) we now start preprocessing the main source file and inject the predefines as a "psuedo #include" from the main source file. 2. #1 allows us to nuke the Lexer::IsMainFile flag and simplify Preprocessor::isInPrimaryFile. 3. The driver doesn't have to know about standard #defines, the preprocessor knows, which is nice for people wanting to define their own drivers. 4. This allows us to put normal tokens in the predefine buffer, for example a definition for __builtin_va_list that is target-specific, and a typedef for id in objc. llvm-svn: 42818
* Switch lexer/pp over to new Token::is/isNot apiChris Lattner2007-10-091-32/+32
| | | | llvm-svn: 42799
* improve layering:Chris Lattner2007-10-071-21/+43
| | | | | | | | | Now instead of IdentifierInfo knowing anything about MacroInfo, only the preprocessor knows. This makes MacroInfo truly private to the Lex library (and its direct clients) instead of being accessed in the Basic library. llvm-svn: 42727
* change calls to getMacroInfo into hasMacroDefinition() where possible.Chris Lattner2007-10-071-3/+3
| | | | llvm-svn: 42726
* If we see an invalid #ifdef directive, enter a conditional compilation regionChris Lattner2007-09-241-1/+6
| | | | | | so that we don't emit an error on the #endif. Suggestion by Neil. llvm-svn: 42258
* Add #include required on win32.Chris Lattner2007-09-031-0/+1
| | | | llvm-svn: 41686
* Fix a scoping bug that apple gcc doesn't catch for some reason.Chris Lattner2007-07-231-1/+2
| | | | llvm-svn: 40450
OpenPOWER on IntegriCloud