Commit Graph

139 Commits

Author SHA1 Message Date
Fariborz Jahanian 0f3aecf272 Fix rewriting of ivars. Fixes radar 7490331.
llvm-svn: 92924
2010-01-07 18:18:32 +00:00
Fariborz Jahanian 6722fc0c09 Make this test be ingored for linux.
llvm-svn: 92880
2010-01-07 00:31:48 +00:00
Fariborz Jahanian bdf198bc59 Fixes the test.
llvm-svn: 92875
2010-01-06 23:54:34 +00:00
Fariborz Jahanian 017a6067e5 Test case for rewriting of __weak byref objects.
llvm-svn: 92868
2010-01-06 23:31:34 +00:00
Kovarththanan Rajaratnam 55e74a1a6a Remove RewriteBlocks. It has been superseded by RewriteObjC
llvm-svn: 92014
2009-12-23 18:03:34 +00:00
Fariborz Jahanian 6ab7ed40c7 Implemented rewriting of invocation of a block ivar.
(radar 7482224).
 

llvm-svn: 91652
2009-12-18 01:15:21 +00:00
Daniel Dunbar 8fbe78f6fc Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
   which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
   can be useful to redefine what gets run as 'clang -cc1' (for example, to set
   a default target).

llvm-svn: 91446
2009-12-15 20:14:24 +00:00
Fariborz Jahanian d1a2d5719a Implement conditional block invocation rewrite
and some clean up and a block rewriter test.

llvm-svn: 91435
2009-12-15 17:30:20 +00:00
Fariborz Jahanian c749f2b62f Make tests use the new clang -cc1 flag.
llvm-svn: 91299
2009-12-14 17:47:10 +00:00
Steve Naroff ec60b43ee2 Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=71225
http://llvm.org/viewvc/llvm-project?view=rev&revision=73207
http://llvm.org/viewvc/llvm-project?view=rev&revision=73414

llvm-svn: 90677
2009-12-05 21:43:12 +00:00
Daniel Dunbar a12113c789 Use '-o' '-' instead of '-o=-' in tests.
llvm-svn: 90067
2009-11-29 09:32:12 +00:00
Daniel Dunbar 8b57697954 Eliminate &&s in tests.
- 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious.

llvm-svn: 86430
2009-11-08 01:45:36 +00:00
Mike Stump 753d120975 Prep for new warning.
llvm-svn: 76709
2009-07-22 00:43:08 +00:00
Daniel Dunbar a45cf5b6b0 Rename clang to clang-cc.
Tests and drivers updated, still need to shuffle dirs.

llvm-svn: 67602
2009-03-24 02:24:46 +00:00
Douglas Gregor ac5d4c5f8e Extend builtin "attribute" syntax to include a notation for
printf-like functions, both builtin functions and those in the
C library. The function-call checker now queries this attribute do
determine if we have a printf-like function, rather than scanning
through the list of "known functions IDs". However, there are 5
functions they are not yet "builtins", so the function-call checker
handles them specifically still:

  - fprintf and vfprintf: the builtins mechanism cannot (yet)
    express FILE* arguments, so these can't be encoded.
  - NSLog: the builtins mechanism cannot (yet) express NSString*
    arguments, so this (and NSLogv) can't be encoded.
  - asprintf and vasprintf: these aren't part of the C99 standard
    library, so we really shouldn't be defining them as builtins in
    the general case (and we don't seem to have the machinery to make
    them builtins only on certain targets and depending on whether
    extensions are enabled).

llvm-svn: 64512
2009-02-14 00:32:47 +00:00
Steve Naroff 6ab6dc75ef Fix <rdar://problem/6465284> clang ObjC rewriter: objc_super messed up again.
llvm-svn: 61384
2008-12-23 20:11:22 +00:00
Steve Naroff 08628db9d2 Fix <rdar://problem/6429113> clang ObjC rewriter: crash rewriting file with Blocks and properties
More fancy footwork to cope with rewriting property 'setters'.

llvm-svn: 60760
2008-12-09 12:56:34 +00:00
Steve Naroff 1042ff345a Handle chained/nested property 'getters' (obj.p1.p2.p3).
This is a follow-up to fixing <rdar://problem/6213955> clang ObjC rewriter: rewriter doesn't appear to support @property and @synthesize.

llvm-svn: 60700
2008-12-08 16:43:47 +00:00
Steve Naroff 6d6da255fb Fixed <rdar://problem/6213808> clang ObjC rewriter: @finally is not always executed
llvm-svn: 60593
2008-12-05 17:03:39 +00:00
Chris Lattner 2ca529ce61 instead of forcing blocks on by default, make them default to off, but let
specific targets default them to on.  Default blocks to on on 10.6 and later.
Add a -fblocks option that allows the user to override the target's default.
Use -fblocks in the various testcases that use blocks.

llvm-svn: 60563
2008-12-04 23:20:07 +00:00
Steve Naroff dbfc693f47 Fix <rdar://problem/6291588> assertion failure: SourceManager.h line 489.
llvm-svn: 59664
2008-11-19 21:15:47 +00:00
Steve Naroff e17f52fc23 Tighten up blocks rewriter to handle casts and some other interesting cases.
This fixes <rdar://problem/6289007> clang block rewriter: ^ in cast is not rewritten.

llvm-svn: 57591
2008-10-15 18:38:58 +00:00
Steve Naroff 87930ca38f Teach block rewriter to replace '^' with '*' in VarDecls.
Since we don't have DeclGroup's and location information for types, there is some fancy footwork to do this fairly reliably.

O.K...it's a kludge. One day, we can use this as motivation to do this more gracefully:-)

llvm-svn: 56499
2008-09-23 19:24:41 +00:00
Steve Naroff ad7013b1e6 Fix crasher in RewriteObjC::RewriteObjCSynchronizedStmt(). Can't depend on the source locations of the sync expression (since it may have been rewritten.
Fixes <rdar://problem/6156363> clang ObjC rewriter: rewriting attached file causes assertion failure: invalid FileID

llvm-svn: 54986
2008-08-19 13:04:19 +00:00
Daniel Dunbar 5b288788b3 Fix a test RUN line to not generate '=-' in test directory
llvm-svn: 53865
2008-07-21 18:42:27 +00:00
Steve Naroff ce2dca186b RewriteObjC::RewriteObjCTryStmt():Don't synthesize a catch begin if there are 0 catch clauses.
This fixes <rdar://problem/5987211> clang ObjC rewriter: @try / @finally block produces unbalanced output.

llvm-svn: 53679
2008-07-16 15:31:30 +00:00
Chris Lattner a9b3cae8fd Switch 'super' from being a weird cast thing to being a predefined expr node.
Patch by David Chisnall with objc rewriter and stmtdumper updates from me.

llvm-svn: 52580
2008-06-21 18:04:54 +00:00
Argyrios Kyrtzidis 351763e156 Multiple tests in a single test file must be linked with '&&'.
Otherwise, failing tests other than the last one will not be reported.

llvm-svn: 52231
2008-06-12 12:40:02 +00:00
Eli Friedman 7e4f41ef3f Don't include objc.h, so the rewriter tests work on machines without it.
llvm-svn: 52082
2008-06-07 23:15:03 +00:00
Chris Lattner 10a7bd6341 fix a nasty off-by-one error.
llvm-svn: 51519
2008-05-23 23:29:33 +00:00
Chris Lattner 17c2476d0b fix an inconsistency computing offsets that caused a crash on rewrite-nest.m
llvm-svn: 51514
2008-05-23 23:06:56 +00:00
Steve Naroff 1dc53ef494 Rename RewriteTest->RewriteObjC.
llvm-svn: 49692
2008-04-14 22:03:09 +00:00
Steve Naroff f9e7c90129 Only have the rewriter produce a file when there are no errors.
llvm-svn: 48926
2008-03-28 22:26:09 +00:00
Steve Naroff c10c2e339f Fix rewriter tests to work with new output file logic. This changes forces the output to standard out (rather than generate a .cpp file, which is the new default for the rewriter).
llvm-svn: 48847
2008-03-26 22:28:40 +00:00
Chris Lattner 97d496c182 Teach the rewriter how to respect the -o option.
llvm-svn: 48669
2008-03-22 00:08:40 +00:00
Steve Naroff 35cb7960e3 Two fixes to RewriteTest::RewriteObjCIvarRefExpr():
- 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.

llvm-svn: 48309
2008-03-12 23:15:19 +00:00
Steve Naroff 4182fd56ad Since the rewriter now outputs C++, it no longer makes sense to pipe the output to clang.
This should "fix" all but one of the test failure.

llvm-svn: 48275
2008-03-12 02:07:40 +00:00
Steve Naroff edb5bc6f09 Fix two rewriter bugs with @catch.
- 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.

llvm-svn: 46644
2008-02-01 20:02:07 +00:00
Ted Kremenek e9a709a0c5 Moved "Rewriter" tests from test/Sema to test/Rewriter.
llvm-svn: 46640
2008-02-01 17:05:54 +00:00