summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PrintPreprocessedOutput.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Frontend: Factor out header include dumping (-H) into its own preprocessorDaniel Dunbar2011-02-021-36/+4
| | | | | | | | callbacks class. - Aside from being generally cleaner, this also allows -H to work correctly in modes other than standard preprocessing (e.g., -c, -MM, etc.) llvm-svn: 124723
* Several PPCallbacks take an SourceLocation + IdentifierInfo, ratherCraig Silverstein2010-11-191-10/+7
| | | | | | | | | | | than a Token that holds the same information all in one easy-to-use package. There's no technical reason to prefer the former -- the information comes from a Token originally -- and it's clumsier to use, so I've changed the code to use tokens everywhere. Approved by clattner llvm-svn: 119845
* Make sure to always check the result ofDouglas Gregor2010-11-121-6/+20
| | | | | | | SourceManager::getPresumedLoc(), so that we don't try to make use of an invalid presumed location. Doing so can cause crashes. llvm-svn: 118885
* make sure #pragma clang is treated the same way as #pragma gcc in -E mode,Chris Lattner2010-11-101-2/+3
| | | | | | unknown pragmas should just be passed through to the .i file. llvm-svn: 118659
* Handle '#line' in '-E' that has an empty file name. Fixes ↵Ted Kremenek2010-09-171-2/+2
| | | | | | <rdar://problem/8439412>. llvm-svn: 114142
* Make sure we're producing a newline in the preprocessed output beforeDouglas Gregor2010-09-101-2/+1
| | | | | | emitting a #pragma, whenever one is needed. Fixes <rdar://problem/8417307>. llvm-svn: 113648
* When we parse a pragma, keep track of how that pragma was originallyDouglas Gregor2010-09-091-4/+20
| | | | | | | | spelled (#pragma, _Pragma, __pragma). In -E mode, use that information to add appropriate newlines when translating _Pragma and __pragma into #pragma, like GCC does. Fixes <rdar://problem/8412013>. llvm-svn: 113553
* Frontend/-H: Add comment on why I used a temporary string here.Daniel Dunbar2010-09-081-0/+1
| | | | llvm-svn: 113379
* Frontend: Add basic -H support.Daniel Dunbar2010-08-241-7/+39
| | | | | | | - I didn't implement the GCC "multiple include guard" detection parts, because it doesn't seem useful or obvious. llvm-svn: 111983
* Push location through the MacroUndefined PPCallback and use it to print ↵Benjamin Kramer2010-08-071-0/+13
| | | | | | #undefs in -dD mode. (PR7818) llvm-svn: 110523
* Modify the pragma handlers to accept and use StringRefs instead of ↵Argyrios Kyrtzidis2010-07-131-3/+3
| | | | | | | | | | | IdentifierInfos. When loading the PCH, IdentifierInfos that are associated with pragmas cause declarations that use these identifiers to be deserialized (e.g. the "clang" pragma causes the "clang" namespace to be loaded). We can avoid this if we just use StringRefs for the pragmas. As a bonus, since we don't have to create and pass IdentifierInfos, the pragma interfaces get a bit more simplified. llvm-svn: 108237
* Implement support for #pragma message, patch by Michael Spencer!Chris Lattner2010-06-261-1/+25
| | | | llvm-svn: 106950
* fix the various buildbot failures by ensuring that tokens are really ↵Chris Lattner2010-06-151-4/+3
| | | | | | completely initialized. llvm-svn: 106043
* fix an uninitialized variable, patch by Michael Spencer!Chris Lattner2010-06-151-0/+2
| | | | llvm-svn: 106025
* fix PR7360: -P mode turns off line markers, but not blank space.Chris Lattner2010-06-121-15/+10
| | | | | | | Apparently some programs which abuse the preprocessor depend on this. llvm-svn: 105889
* Preprocessor: Ignore unknown pragmas in -E -dM and -Eonly modes.Daniel Dunbar2010-06-111-0/+3
| | | | llvm-svn: 105830
* push some source location information down through the compiler,Chris Lattner2010-04-201-4/+2
| | | | | | | | into ContentCache::getBuffer. This allows it to produce diagnostics on the broken #include line instead of without a location. llvm-svn: 101939
* Remove this hard-coded buffer size. In some basic experiments preprocessingDan Gohman2010-04-161-2/+0
| | | | | | | | | | | large files, this doesn't seem significantly better than just letting raw_ostream pick a buffer size. This code predates raw-ostream's automatic buffer sizing; in fact, it was introduced as part of the code which would eventually become raw_ostream. llvm-svn: 101473
* Improve line marker directive locations, patch by Jordy RoseChris Lattner2010-04-141-1/+1
| | | | llvm-svn: 101226
* make the token paste avoidance logic turn "..." into ".. ." instead of ". . ."Chris Lattner2010-04-141-3/+6
| | | | | | when avoiding paste. Patch by David Peixotto! llvm-svn: 101218
* cache the PP's SourceManager.Chris Lattner2010-04-131-5/+6
| | | | llvm-svn: 101099
* make the preprocessor listen to linemarker directives in -E mode,Chris Lattner2010-04-131-10/+14
| | | | | | PR6101. This is based on a patch and testcase by Jordy Rose! llvm-svn: 101097
* Entering the main source file in the preprocessor can fail if theDouglas Gregor2010-03-171-2/+4
| | | | | | source file has been changed. Handle that failure more gracefully. llvm-svn: 98727
* Use SmallString instead of SmallVectorKovarththanan Rajaratnam2010-03-131-1/+1
| | | | llvm-svn: 98436
* Rename to addPPCallbacks since we're effectively adding a callback and maybe ↵Kovarththanan Rajaratnam2010-03-071-4/+4
| | | | | | chaining it to an existing one llvm-svn: 97913
* Revert 97324. Chris says this cleanup could hurt -E performance.Benjamin Kramer2010-02-271-8/+24
| | | | llvm-svn: 97331
* Simplify code.Benjamin Kramer2010-02-271-24/+8
| | | | llvm-svn: 97324
* Add an overload of Preprocessor::getSpelling which takes a SmallVector andBenjamin Kramer2010-02-271-6/+1
| | | | | | returns a StringRef. Use it to simplify some repetitive code. llvm-svn: 97322
* Avoid an instantiation of std::sort.Benjamin Kramer2010-01-191-14/+10
| | | | llvm-svn: 93882
* Neil points out that this could be simplified, do it.Chris Lattner2009-12-091-15/+9
| | | | llvm-svn: 90927
* fix -dM with variadic macros, PR5699Chris Lattner2009-12-071-8/+15
| | | | llvm-svn: 90735
* some code cleanup.Chris Lattner2009-12-071-9/+14
| | | | llvm-svn: 90732
* Integrate the following from the 'objective-rewrite' branch:Steve Naroff2009-12-061-7/+13
| | | | | | http://llvm.org/viewvc/llvm-project?view=rev&revision=71473 llvm-svn: 90688
* Add PreprocessorOutputOptions to CompilerInvocation, and move initialization toDaniel Dunbar2009-11-111-1/+1
| | | | | | clang-cc/Options.cpp llvm-svn: 86828
* Add PreprocessorOutputOptions, for things like -dM, -C, -CC which control -EDaniel Dunbar2009-11-111-10/+16
| | | | | | mode. llvm-svn: 86827
* Fix buffer overflow in PrintMacroDefinition() by inverting the check to see ↵Ted Kremenek2009-11-031-1/+1
| | | | | | if the target buffer needs to be resized. Fixes <rdar://problem/7255377>. llvm-svn: 85872
* PR5218: Replace IdentifierInfo::getName with StringRef version, now that clientsDaniel Dunbar2009-10-181-2/+2
| | | | | | are updated. llvm-svn: 84447
* Move misc clients to IdentifierInfo StringRef API.Daniel Dunbar2009-10-181-2/+2
| | | | | | | | | - strcmp -> == - OS.write(II->getName() ...) -> OS << II->getNameStr() - Avoid std::string concatenation - Use getNameStr().str() when an std::string is really needed. llvm-svn: 84437
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-48/+48
| | | | llvm-svn: 81346
* no really, add the lines :)Chris Lattner2009-06-151-1/+1
| | | | llvm-svn: 73367
* Fix PR2741 by making our newline tracking be aware of newlines thatChris Lattner2009-06-151-0/+35
| | | | | | can occur in the middle of comment tokens. llvm-svn: 73365
* PR4288: Make -dD (dump macros with preprocessed source) play nicely with Eli Friedman2009-06-021-2/+7
| | | | | | # line directives. llvm-svn: 72724
* Use v.data() instead of &v[0] when SmallVector v might be empty.Jay Foad2009-05-211-1/+1
| | | | llvm-svn: 72210
* Clean up some unnecessary includes.Eli Friedman2009-05-191-2/+0
| | | | llvm-svn: 72101
* Move clang-cc.h to lib/Frontend/Utils.h, and move the associated .cpp Eli Friedman2009-05-191-0/+467
files to lib/Frontend. llvm-svn: 72099
OpenPOWER on IntegriCloud