summaryrefslogtreecommitdiff
path: root/lib/Frontend/PrintPreprocessedOutput.cpp
Commit message (Collapse)AuthorAge
...
* For the FileChanged Preprocessor callback, when exiting a file, pass its FileID.Argyrios Kyrtzidis2011-10-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141681 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear ↵Francois Pichet2011-09-17
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139987 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename getInstantiationColumnNumber to getExpansionColumnNumber in bothChandler Carruth2011-07-25
| | | | | | SourceManager and FullSourceLoc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135965 91177308-0d34-0410-b5e6-96231b3b80d8
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-23
| | | | | | | | | LLVM.h imports them into the clang namespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the remaining comments in Frontend to 'expansion'.Chandler Carruth2011-07-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135150 91177308-0d34-0410-b5e6-96231b3b80d8
* Copy diagnostic pragmas to the preprocessed output, from Richard Osborne!Douglas Gregor2011-06-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133633 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename tok::eom to tok::eod.Peter Collingbourne2011-02-28
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126631 91177308-0d34-0410-b5e6-96231b3b80d8
* Frontend: Factor out header include dumping (-H) into its own preprocessorDaniel Dunbar2011-02-02
| | | | | | | | 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.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124723 91177308-0d34-0410-b5e6-96231b3b80d8
* Several PPCallbacks take an SourceLocation + IdentifierInfo, ratherCraig Silverstein2010-11-19
| | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119845 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure to always check the result ofDouglas Gregor2010-11-12
| | | | | | | | SourceManager::getPresumedLoc(), so that we don't try to make use of an invalid presumed location. Doing so can cause crashes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118885 91177308-0d34-0410-b5e6-96231b3b80d8
* make sure #pragma clang is treated the same way as #pragma gcc in -E mode,Chris Lattner2010-11-10
| | | | | | | unknown pragmas should just be passed through to the .i file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118659 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle '#line' in '-E' that has an empty file name. Fixes ↵Ted Kremenek2010-09-17
| | | | | | <rdar://problem/8439412>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114142 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure we're producing a newline in the preprocessed output beforeDouglas Gregor2010-09-10
| | | | | | | | emitting a #pragma, whenever one is needed. Fixes <rdar://problem/8417307>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113648 91177308-0d34-0410-b5e6-96231b3b80d8
* When we parse a pragma, keep track of how that pragma was originallyDouglas Gregor2010-09-09
| | | | | | | | | 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>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113553 91177308-0d34-0410-b5e6-96231b3b80d8
* Frontend/-H: Add comment on why I used a temporary string here.Daniel Dunbar2010-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113379 91177308-0d34-0410-b5e6-96231b3b80d8
* Frontend: Add basic -H support.Daniel Dunbar2010-08-24
| | | | | | | - I didn't implement the GCC "multiple include guard" detection parts, because it doesn't seem useful or obvious. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111983 91177308-0d34-0410-b5e6-96231b3b80d8
* Push location through the MacroUndefined PPCallback and use it to print ↵Benjamin Kramer2010-08-07
| | | | | | #undefs in -dD mode. (PR7818) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110523 91177308-0d34-0410-b5e6-96231b3b80d8
* Modify the pragma handlers to accept and use StringRefs instead of ↵Argyrios Kyrtzidis2010-07-13
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108237 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement support for #pragma message, patch by Michael Spencer!Chris Lattner2010-06-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106950 91177308-0d34-0410-b5e6-96231b3b80d8
* fix the various buildbot failures by ensuring that tokens are really ↵Chris Lattner2010-06-15
| | | | | | completely initialized. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106043 91177308-0d34-0410-b5e6-96231b3b80d8
* fix an uninitialized variable, patch by Michael Spencer!Chris Lattner2010-06-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106025 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR7360: -P mode turns off line markers, but not blank space.Chris Lattner2010-06-12
| | | | | | | | Apparently some programs which abuse the preprocessor depend on this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105889 91177308-0d34-0410-b5e6-96231b3b80d8
* Preprocessor: Ignore unknown pragmas in -E -dM and -Eonly modes.Daniel Dunbar2010-06-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105830 91177308-0d34-0410-b5e6-96231b3b80d8
* push some source location information down through the compiler,Chris Lattner2010-04-20
| | | | | | | | | into ContentCache::getBuffer. This allows it to produce diagnostics on the broken #include line instead of without a location. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101939 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove this hard-coded buffer size. In some basic experiments preprocessingDan Gohman2010-04-16
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101473 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve line marker directive locations, patch by Jordy RoseChris Lattner2010-04-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101226 91177308-0d34-0410-b5e6-96231b3b80d8
* make the token paste avoidance logic turn "..." into ".. ." instead of ". . ."Chris Lattner2010-04-14
| | | | | | | when avoiding paste. Patch by David Peixotto! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101218 91177308-0d34-0410-b5e6-96231b3b80d8
* cache the PP's SourceManager.Chris Lattner2010-04-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101099 91177308-0d34-0410-b5e6-96231b3b80d8
* make the preprocessor listen to linemarker directives in -E mode,Chris Lattner2010-04-13
| | | | | | | PR6101. This is based on a patch and testcase by Jordy Rose! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101097 91177308-0d34-0410-b5e6-96231b3b80d8
* Entering the main source file in the preprocessor can fail if theDouglas Gregor2010-03-17
| | | | | | | source file has been changed. Handle that failure more gracefully. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98727 91177308-0d34-0410-b5e6-96231b3b80d8
* Use SmallString instead of SmallVectorKovarththanan Rajaratnam2010-03-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98436 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename to addPPCallbacks since we're effectively adding a callback and maybe ↵Kovarththanan Rajaratnam2010-03-07
| | | | | | chaining it to an existing one git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97913 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 97324. Chris says this cleanup could hurt -E performance.Benjamin Kramer2010-02-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97331 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify code.Benjamin Kramer2010-02-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97324 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an overload of Preprocessor::getSpelling which takes a SmallVector andBenjamin Kramer2010-02-27
| | | | | | | returns a StringRef. Use it to simplify some repetitive code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97322 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid an instantiation of std::sort.Benjamin Kramer2010-01-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93882 91177308-0d34-0410-b5e6-96231b3b80d8
* Neil points out that this could be simplified, do it.Chris Lattner2009-12-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90927 91177308-0d34-0410-b5e6-96231b3b80d8
* fix -dM with variadic macros, PR5699Chris Lattner2009-12-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90735 91177308-0d34-0410-b5e6-96231b3b80d8
* some code cleanup.Chris Lattner2009-12-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90732 91177308-0d34-0410-b5e6-96231b3b80d8
* Integrate the following from the 'objective-rewrite' branch:Steve Naroff2009-12-06
| | | | | | | | http://llvm.org/viewvc/llvm-project?view=rev&revision=71473 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90688 91177308-0d34-0410-b5e6-96231b3b80d8
* Add PreprocessorOutputOptions to CompilerInvocation, and move initialization toDaniel Dunbar2009-11-11
| | | | | | clang-cc/Options.cpp git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86828 91177308-0d34-0410-b5e6-96231b3b80d8
* Add PreprocessorOutputOptions, for things like -dM, -C, -CC which control -EDaniel Dunbar2009-11-11
| | | | | | mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86827 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix buffer overflow in PrintMacroDefinition() by inverting the check to see ↵Ted Kremenek2009-11-03
| | | | | | if the target buffer needs to be resized. Fixes <rdar://problem/7255377>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85872 91177308-0d34-0410-b5e6-96231b3b80d8
* PR5218: Replace IdentifierInfo::getName with StringRef version, now that clientsDaniel Dunbar2009-10-18
| | | | | | are updated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84447 91177308-0d34-0410-b5e6-96231b3b80d8
* Move misc clients to IdentifierInfo StringRef API.Daniel Dunbar2009-10-18
| | | | | | | | | - strcmp -> == - OS.write(II->getName() ...) -> OS << II->getNameStr() - Avoid std::string concatenation - Use getNameStr().str() when an std::string is really needed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84437 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
* no really, add the lines :)Chris Lattner2009-06-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73367 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2741 by making our newline tracking be aware of newlines thatChris Lattner2009-06-15
| | | | | | | can occur in the middle of comment tokens. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73365 91177308-0d34-0410-b5e6-96231b3b80d8
* PR4288: Make -dD (dump macros with preprocessed source) play nicely with Eli Friedman2009-06-02
| | | | | | | | # line directives. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72724 91177308-0d34-0410-b5e6-96231b3b80d8
* Use v.data() instead of &v[0] when SmallVector v might be empty.Jay Foad2009-05-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72210 91177308-0d34-0410-b5e6-96231b3b80d8