aboutsummaryrefslogtreecommitdiff
path: root/Driver/RewriteMacros.cpp
AgeCommit message (Collapse)Author
2009-03-24Move <root>/Driver into <root>/tools/clang-cc.Daniel Dunbar
Again, I tried to update cmake but it is untested. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67605 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27rename getFullFilePos -> getFileOffset.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63097 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17use simplified Lexer ctor.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62416 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17this massive patch introduces a simple new abstraction: it makesChris Lattner
"FileID" a concept that is now enforced by the compiler's type checker instead of yet-another-random-unsigned floating around. This is an important distinction from the "FileID" currently tracked by SourceLocation. *That* FileID may refer to the start of a file or to a chunk within it. The new FileID *only* refers to the file (and its #include stack and eventually #line data), it cannot refer to a chunk. FileID is a completely opaque datatype to all clients, only SourceManager is allowed to poke and prod it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62407 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16more SourceLocation lexicon change: instead of referring to theChris Lattner
"logical" location, refer to the "instantiation" location. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62316 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13[LLVM up] Update for raw_fd_ostream change. This fixes a FIXME thatDaniel Dunbar
the Backend output should be done in binary mode. - I'd appreciate it if someone who has a Windows build could verify this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59221 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12Change how raw lexers are handled: instead of creating them and thenChris Lattner
using LexRawToken, create one and use LexFromRawLexer. This avoids twiddling the RawLexer flag around and simplifies some code (even speeding raw lexing up a tiny bit). This change also improves the token paster to use a Lexer on the stack instead of new/deleting it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57393 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-13Patch by Csaba Hruska!Ted Kremenek
"Here is a patch what replaces std::ostream with llvm::raw_ostream. This patch covers the AST library, but ignores Analysis lib." git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56185 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-14Fix typo.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54774 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25comment out #pragma mark and #warning directives.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54020 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25rewrite handling of the raw token stream in -rewrite-macros to lexChris Lattner
everything up front into a vector. This makes it easier to scan around the stream when needed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54019 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03make rewrite macros insert a space when commenting out macros where the ↵Chris Lattner
token didn't lead with a space. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51896 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31Two identifiers are not the same unless they have the same identifier info.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51827 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-10Implement -rewrite-macros, which is a crazy macro expander that expandsChris Lattner
macros but doesn't expand #includes, remove comments, remove #defines etc. For example: ---- #include <stdio.h> #define bbaa #define funclike(x) x "a" x "b" x bbaa bbaa #if 1 funclike("gar") foo /*blah*/ bar bar #endif #if 0 funclike() #endif ---- rewrites to: ---- #include <stdio.h> #define bbaa #define funclike(x) x "a" x "b" x /*bbaa bbaa*/ #if 1 "gar" "a" "gar" "b" "gar"/*funclike*//*("gar")*/ foo /*blah*/ bar bar #endif #if 0 /*funclike()*/ #endif ---- git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50925 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-09make #if 0 code compile, even though it still isn't very useful.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50920 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08start implementation of a macro rewriter, this is currently just stubbed out.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50845 91177308-0d34-0410-b5e6-96231b3b80d8