aboutsummaryrefslogtreecommitdiff
path: root/Driver/RewriteTest.cpp
AgeCommit message (Collapse)Author
2008-10-20Add newline at the end of file, to silence compiler warning.Matthijs Kooijman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57818 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12make the -rewrite-test a bit more interesting: it now Chris Lattner
wraps comments in <i> tags. Extend rewrite tokens to support this minimal functionality. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57409 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12start implementing a token rewriter. At this point, it just reads in a fileChris Lattner
and lets a client iterate over it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57407 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12Add a new -rewrite-test option, which is basically a Chris Lattner
playground to experiment with some new rewriter approaches. For now it is probably the most complex version of 'cat' ever invented. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57406 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14Rename a file and update the Xcode project.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49693 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14Rename RewriteTest->RewriteObjC.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49692 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14Use isFromMainFile instead of comparing FileIDs directly.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49687 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08silence some warnings when assertions are disabled.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49372 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06This patch contains these changes:Chris Lattner
-Renamed ContextDecl -> DeclContext -Removed DeclContext pointer from FieldDecl -EnumDecl inherits from DeclContext, instead of TagDecl Patch by Argiris Kirtzidis! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49261 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04Avoid implicitly including any header files (requested by ckane).Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49241 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04Rewrite @package (an ObjC 2.0 idiom).Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49238 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04Fix MS-specific bug in RewriteTest::RewriteObjCMethodDecl().Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49237 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04Introduce ContextDecl, patch by Argiris Kirtzidis!Chris Lattner
-Added ContextDecl (no TranslationUnitDecl) -ScopedDecl class has a ContextDecl member -FieldDecl class has a ContextDecl member, so that a Field or a ObjCIvar can be traced back to their RecordDecl/ObjCInterfaceDecl easily -FunctionDecl, ObjCMethodDecl, TagDecl, ObjCInterfaceDecl inherit from ContextDecl. With TagDecl as ContextDecl, enum constants have a EnumDecl as their context. -Moved Decl class to a "DeclBase.h" along with ContextDecl class -CurContext is handled by Sema git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49208 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-28Only have the rewriter produce a file when there are no errors.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48926 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27Add some of Ted's recent work to the VC++ project file.Steve Naroff
Fix a couple bozo bugs in the rewriter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48903 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27Collect all the preamble code and don't insert it until the end. Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48899 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-24Add a couple files to VC++ project and cleanup an "#if 0".Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48748 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-22Teach the rewriter how to respect the -o option.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48669 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-18Fix <rdar://problem/5716940> rewriter generates invalid C code when no ↵Steve Naroff
selector found. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48479 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-18Wrap up __NSConstantStringImpl (the replacement for ↵Steve Naroff
__builtin___CFStringMakeConstantString). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48477 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16make property addition work list all other "add" methods. Do Chris Lattner
the allocation in the class, not in sema. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48433 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16Convert more counts to be zero based instead of -1 based, make them unsigned.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48429 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16minor cleanups, make getNumInstanceMethods always return unsigned.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48423 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16Make the parameter count of ObjCMethodDecl unsigned, youChris Lattner
can't have negative arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48407 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16switch the rest of the C decl classes to do their Chris Lattner
allocation through ASTContext. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48403 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-15move the ASTContext argument to be first in the argument list of Chris Lattner
all Create methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48398 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-15Switch over functiondecl. This makes it obvious that the ASTContextChris Lattner
argument to Create should be first, not last. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48397 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-15switch the VarDecl allocation model to go through ASTContext.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48396 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-15start switching decls over to using an allocator controlled by ASTContext. Chris Lattner
Right now only some ctors are switched over. I need to switch them all over so I can change the dtor over. This lets us experiment with region allocation and other things in the future. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48390 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-15Link against the correct ObjC string class ↵Steve Naroff
(__CFConstantStringClassReference) and fix length computation (removing a FIXME). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48384 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-15Remove ObjC rewriter dependency on GCC's __builtin___CFStringMakeConstantString.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48383 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-12Two fixes to RewriteTest::RewriteObjCIvarRefExpr():Steve Naroff
- For explicit ivar refers, make sure the cast is propagated to the AST. - Don't free the base (since it is still in use). This fixes the recent regression to test/Rewriter/objc-ivar-receiver-1.m. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48309 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-12Minor aesthetic improvement (after I reviewed my last commit).Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48304 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-12Avoid using the "unnamed struct field" extension (enabled with ↵Steve Naroff
-fms-extensions). This feature/extension silently does the wrong thing in g++. As far as I can tell, g++ simply throws the field away entirely (note that it works fine with gcc). Since I am now always casting the object (for other reasons), accessing protected/public fields simply requires the cast refer to the defining class. This solution is simpler all around (thanks to Chris for suggesting it). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48302 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-12Use the "used" attribute. Without it, g++ removes all the meta-data:-( This ↵Steve Naroff
doesn't happen when compiling straight C code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48287 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-12-Add missing visitor for ObjCIvarRefExpr.Steve Naroff
-Wrap objc runtime calls with "extern "C"" (for now). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48284 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-12Remove more dependencies on C "flexible array member" idiom (when generating ↵Steve Naroff
meta-data). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48271 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-12Make ivar rewrite C++ friendly (since C++ forces a unified namespace for ↵Steve Naroff
typedefs/structures). The previous version of the rewriter generated both a type def and structure def for each class (which doesn't fly in C++). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48266 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-11Make "super" rewrite for class methods C++ friendly (follow-up from last ↵Steve Naroff
commit). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48235 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-11Make "super" rewrite C++ friendly (since it doesn't support Compound Literals).Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48230 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-11Generate meta-data in a C++ compatible way (remove 2 dependencies on C ↵Steve Naroff
"flexible array member" idiom and perform some extra casts). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48202 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10Missed a couple "_IMPL" suffixes.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48191 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10Fix dangling pointer and give the implementation struct for a class a unique ↵Steve Naroff
name. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48190 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10Pass LangOptions to RewriteTest().Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48172 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05remove the source location arguments to various target query methods.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47954 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-06Make sure to propagate qualifiers through the member operator.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46830 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-01Minor API cleanup...Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46649 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-01Remove temporary workaround (thanks to Ted for fixing ObjCAtCatchStmt so ↵Steve Naroff
quickly:-). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46648 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-01Fix two rewriter bugs with @catch.Steve Naroff
- Support @catch(...), rather than crash:-) - Make sure all catch bodies get rewritten. This "fix" is really a workaround until the iterator for the "try" AST is fixed. Will fix this in a separate commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46644 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31add some helper methods for removing and replacing text, this makes theChris Lattner
rewriter more robust. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46622 91177308-0d34-0410-b5e6-96231b3b80d8