summaryrefslogtreecommitdiffstats
path: root/clang/Driver/PrintPreprocessedOutput.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move <root>/Driver into <root>/tools/clang-cc.Daniel Dunbar2009-03-241-469/+0
| | | | | | Again, I tried to update cmake but it is untested. llvm-svn: 67605
* fix test/Preprocessor/macro_paste_mscomment.c.Chris Lattner2009-03-201-1/+1
| | | | llvm-svn: 67403
* factor token concatenation avoidance logic out of Chris Lattner2009-02-131-222/+9
| | | | | | PrintPreprocessedOutput into its own file. No functionality change. llvm-svn: 64418
* make -dM emit macros in a deterministic (sorted) order instead of Chris Lattner2009-02-101-2/+14
| | | | | | random hash table order, I don't like non-determinstic output. llvm-svn: 64248
* use efficient form of getSpelling, this speeds up -dM by 16%.Chris Lattner2009-02-101-1/+9
| | | | llvm-svn: 64244
* Add an implementation of -dM that follows GCC closely enough to permitChris Lattner2009-02-061-25/+87
| | | | | | | diffing the output of: clang -dM -o - -E -x c foo.c | sort llvm-svn: 63926
* factor some code out into a helper function.Chris Lattner2009-02-061-40/+49
| | | | llvm-svn: 63922
* lower the interface to getLineNumber like we did forChris Lattner2009-02-041-1/+1
| | | | | | | | getColumnNumber. This fixes a FIXME in SourceManager::getPresumedLoc because we now just decompose the sloc once. llvm-svn: 63701
* avoid emitting a bogus line marker for the top level #includeChris Lattner2009-01-301-1/+3
| | | | | | | | | | | | | | | | | | | | | location. We now -E a file containing "foo" into: # 1 "t.c" # 1 "t.c" 1 # 1 "<predefines>" 1 # 1 "t.c" 2 foo instead of: # 1 "t.c" # 1 "t.c" 1 # 0 "t.c" # 1 "<predefines>" 1 # 1 "t.c" 2 foo llvm-svn: 63405
* Introduce a new PresumedLoc class to represent the concept of a locationChris Lattner2009-01-271-3/+4
| | | | | | | | | | | | | | | | | | | as reported to the user and as manipulated by #line. This is what __FILE__, __INCLUDE_LEVEL__, diagnostics and other things should follow (but not dependency generation!). This patch also includes several cleanups along the way: - SourceLocation now has a dump method, and several other places that did similar things now use it. - I cleaned up some code in AnalysisConsumer, but it should probably be simplified further now that NamedDecl is better. - TextDiagnosticPrinter is now simplified and cleaned up a bit. This patch is a prerequisite for #line, but does not actually provide any #line functionality. llvm-svn: 63098
* minor speedups/cleanups for -E mode.Chris Lattner2009-01-261-8/+11
| | | | llvm-svn: 63029
* This change refactors some of the low-level lexer interfaces a bit.Chris Lattner2009-01-261-0/+2
| | | | | | | | | | | | | Token now has a class of kinds for "literals", which include numeric constants, strings, etc. These tokens can optionally have a pointer to the start of the token in the lexer buffer. This makes it faster to get spelling and do other gymnastics, because we don't have to go through source locations. This change is performance neutral, but will make other changes more feasible down the road. llvm-svn: 63028
* Make sure to escape " when it occurs in a string in pragma commentChris Lattner2009-01-161-1/+1
| | | | llvm-svn: 62367
* Make -E mode propagate #pragma comment's into the output.Chris Lattner2009-01-161-2/+31
| | | | llvm-svn: 62339
* more SourceLocation lexicon change: instead of referring to theChris Lattner2009-01-161-5/+5
| | | | | | "logical" location, refer to the "instantiation" location. llvm-svn: 62316
* Change some terminology in SourceLocation: instead of referring to Chris Lattner2009-01-161-5/+5
| | | | | | | the "physical" location of tokens, refer to the "spelling" location. This is more concrete and useful, tokens aren't really physical objects! llvm-svn: 62309
* make paste avoidance avoid pasting digraphs and :: only when digraphs or c++ ↵Chris Lattner2009-01-111-3/+6
| | | | | | | | is enabled respectively. Inspired by a patch by Dan Villiom Podlaski Christiansen. llvm-svn: 62044
* [LLVM up] Update for raw_fd_ostream change. This fixes a FIXME thatDaniel Dunbar2008-11-131-1/+1
| | | | | | | | the Backend output should be done in binary mode. - I'd appreciate it if someone who has a Windows build could verify this. llvm-svn: 59221
* Rename Characteristic_t to CharacteristicKindChris Lattner2008-10-271-3/+3
| | | | llvm-svn: 58224
* clean up a bunch of fixme's I added, by moving Chris Lattner2008-09-261-6/+6
| | | | | | DirectoryLookup::DirType into SourceManager.h llvm-svn: 56692
* fit in 80 cols.Chris Lattner2008-09-261-1/+1
| | | | llvm-svn: 56687
* Make clang preprocessed output a bit more like gcc output.Daniel Dunbar2008-09-261-1/+1
| | | | llvm-svn: 56636
* Workaround gcc bug causing crash on our preprocessed outputs.Daniel Dunbar2008-09-051-44/+45
| | | | | | | | | | | | - gcc is not happy if we start a preprocessed file with #line 1 "XXX" 1 - Workaround by making sure file starts with a simple #line change. Also, factored WriteLineInfo out. Also, fixed bug where FileType was not being correctly updated. llvm-svn: 55825
* Use raw_ostream to output an unsigned.Chris Lattner2008-08-191-27/+2
| | | | llvm-svn: 54973
* printing with an unspecified dest means to print to stdout.Chris Lattner2008-08-171-1/+1
| | | | llvm-svn: 54872
* don't delete a variable on the stackChris Lattner2008-08-171-2/+2
| | | | llvm-svn: 54871
* simplify this code a bit more.Chris Lattner2008-08-171-15/+7
| | | | llvm-svn: 54864
* remove global variables for output stream.Chris Lattner2008-08-171-87/+69
| | | | llvm-svn: 54861
* Switch to shared raw_ostream code instead of having it be clang specific.Chris Lattner2008-08-171-101/+17
| | | | | | This also helps the eventual distcc project. llvm-svn: 54858
* Fix rdar://5843510 don't assert and die when an invalid outputChris Lattner2008-04-111-4/+12
| | | | | | file is specified, print a happy little error message. llvm-svn: 49518
* Fix rdar://5846705: "clang -E foo.c -o foo.i" should remove foo.i on error.Chris Lattner2008-04-081-9/+26
| | | | llvm-svn: 49368
* Make -o work with -E, patch contributed by Shantonu Sen!Chris Lattner2008-01-271-11/+31
| | | | llvm-svn: 46426
* avoid pasting L + "foo" into L"foo".Chris Lattner2008-01-151-2/+27
| | | | llvm-svn: 46000
* avoid token pasting between identifiers and wide strings: Chris Lattner2008-01-151-12/+27
| | | | | | abc+L"foo" -> abc L"foo", not abcL"foo" llvm-svn: 45999
* 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-2/+2
| | | | | | | | | 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
* simplify the interfaces to ProcessInputFile and InitializePreprocessorChris Lattner2007-12-151-2/+1
| | | | llvm-svn: 45060
* The flags on tokens indicate whether they are the start of a *physical* line, Chris Lattner2007-12-091-16/+33
| | | | | | | | not the start of a logical line. Be careful about this distinction, which affects when newlines are printed and when paste-avoidance happens, etc. This fixes PR1848, thanks to Neil for noticing this! llvm-svn: 44743
* Fix a pretty big but subtle bug counting the number of newlines to emit.Chris Lattner2007-12-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | This would cause us to emit different code (in -E mode) for these two files: --- #define t(x) x t(a 3) --- #define t(x) x t(a 3) --- In one case, -E would print "a\n3", in the other it printed "a3". Now it prints "a3" for both. This is part of PR1848. llvm-svn: 44742
* fix a bunch of regressions I introduced :(Chris Lattner2007-10-101-1/+1
| | | | llvm-svn: 42846
* clang -E should not print tokens from the predefines buffer.Chris Lattner2007-10-101-5/+16
| | | | llvm-svn: 42838
* Make a significant change to invert the control flow handlingChris Lattner2007-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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
* convert driver over to use Token::is/isNot APIs. fwew, all done.Chris Lattner2007-10-091-10/+9
| | | | llvm-svn: 42800
* Add #ifdefs to make the source portable to windows. Patch contributedChris Lattner2007-09-031-1/+3
| | | | | | by Hartmut Kaiser! llvm-svn: 41684
* avoid std::string yet again.Chris Lattner2007-07-241-2/+4
| | | | llvm-svn: 40462
* Use a smallstring instead of an std::string in FileChanged to avoid some ↵Chris Lattner2007-07-241-3/+6
| | | | | | | | malloc traffic. This speeds up -E on xalancbmk by 2.4% llvm-svn: 40461
* Fix two paste-avoidance bugs I introduced last night. PatchChris Lattner2007-07-231-2/+2
| | | | | | by Neil Booth. This fixes Preprocessor/output_paste_avoid.c llvm-svn: 40454
* avoid creating std::strings in MoveToLineChris Lattner2007-07-231-2/+18
| | | | llvm-svn: 40424
* In OutputString, avoid calling memcpy for really tiny strings. Chris Lattner2007-07-231-1/+14
| | | | | | This speeds up -E on 447.dealII by 5.8% llvm-svn: 40423
* Avoid calling getSpelling at all for identifiers, which areChris Lattner2007-07-231-1/+5
| | | | | | | trivial to handle and very very common. This speeds up -E on 447.dealII by 2.5% llvm-svn: 40422
OpenPOWER on IntegriCloud