summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PrintPreprocessedOutput.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert my patches which removed Diagnostic.h includes by moving some ↵Benjamin Kramer2012-02-071-3/+3
| | | | | | | | | | | | | | | | | | operator overloads out of line. This seems to negatively affect compile time onsome ObjC tests (which use a lot of partial diagnostics I assume). I have to come up with a way to keep them inline without including Diagnostic.h everywhere. Now adding a new diagnostic requires a full rebuild of e.g. the static analyzer which doesn't even use those diagnostics. This reverts commit 6496bd10dc3a6d5e3266348f08b6e35f8184bc99. This reverts commit 7af19b817ba964ac560b50c1ed6183235f699789. This reverts commit fdd15602a42bbe26185978ef1e17019f6d969aa7. This reverts commit 00bd44d5677783527d7517c1ffe45e4d75a0f56f. This reverts commit ef9b60ffed980864a8db26ad30344be429e58ff5. llvm-svn: 150006
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-051-2/+2
| | | | | | | (I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
* Remove Diagnostic.h include from Preprocessor.h.Benjamin Kramer2012-02-041-3/+3
| | | | | | | - Move the offending methods out of line and fix transitive includers. - This required changing an enum in the PPCallback API into an unsigned. llvm-svn: 149782
* Remove unnecessary default cases in switches over enums.David Blaikie2012-01-171-1/+0
| | | | | | This allows -Wswitch-enum to find switches that need updating when these enums are modified. llvm-svn: 148281
* remove unneeded config.h includesDylan Noblesmith2011-12-221-1/+0
| | | | llvm-svn: 147195
* For the FileChanged Preprocessor callback, when exiting a file, pass its FileID.Argyrios Kyrtzidis2011-10-111-2/+4
| | | | llvm-svn: 141681
* Rename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear ↵Francois Pichet2011-09-171-1/+1
| | | | | | | | that this flag must be used only for Microsoft extensions and not emulation; to avoid confusion with the new LangOptions::MicrosoftMode flag. Many of the code now under LangOptions::MicrosoftExt will eventually be moved under the LangOptions::MicrosoftMode flag. llvm-svn: 139987
* Rename getInstantiationColumnNumber to getExpansionColumnNumber in bothChandler Carruth2011-07-251-1/+1
| | | | | | SourceManager and FullSourceLoc. llvm-svn: 135965
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-17/+17
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Update the remaining comments in Frontend to 'expansion'.Chandler Carruth2011-07-141-2/+2
| | | | llvm-svn: 135150
* Copy diagnostic pragmas to the preprocessed output, from Richard Osborne!Douglas Gregor2011-06-221-0/+44
| | | | llvm-svn: 133633
* Rename tok::eom to tok::eod.Peter Collingbourne2011-02-281-1/+1
| | | | | | | | The previous name was inaccurate as this token in fact appears at the end of every preprocessing directive, not just macro definitions. No functionality change, except for a diagnostic tweak. llvm-svn: 126631
* 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
OpenPOWER on IntegriCloud