Commit Graph

30 Commits

Author SHA1 Message Date
Steve Naroff de7d0f69ba Two fixes:
- Make sure ObjCIvarDecl propagates the bitfield width.
- RewriteObjC::SynthesizeIvarOffsetComputation(): Avoid using the __OFFSETOF__ mumbo jumbo for bitfields (since it isn't legal C). This fixes <rdar://problem/5986079> clang ObjC rewriter: bitfields and ivar access don't mix.

llvm-svn: 53694
2008-07-16 18:22:22 +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
Steve Naroff b067bbd019 Teach RewriteObjC::RewriteObjCMethodDecl() to deal with pointer to function return types.
This fixes <rdar://problem/6034961> clang ObjC rewriter: rewriting methods with function pointer return values does not work

llvm-svn: 53678
2008-07-16 14:40:40 +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
Chris Lattner 5696e7badf Change self/_cmd to be instances of ImplicitParamDecl instead of ParmVarDecl.
Patch by David Chisnall!

llvm-svn: 52422
2008-06-17 18:05:57 +00:00
Argyrios Kyrtzidis 554a07bab3 -Changes to TagDecl:
Added TagKind enum.
  Added getTagKind() method.
  Added convenience methods: isEnum(), isStruct(), isUnion(), isClass().
-RecordDecl/CXXRecordDecl::Create() accept a TagKind enum instead of a DeclKind one.

llvm-svn: 52160
2008-06-09 23:19:58 +00:00
Steve Naroff f611964230 Fix <rdar://problem/5976164> clang ObjC rewriter: for ... in enumeration inserts undeclared function (objc_enumerationMutation should be in preamble)
llvm-svn: 51880
2008-06-02 20:23:21 +00:00
Ted Kremenek 380df93fd6 Added "InitializeTU" to ASTConsumer. This is used by Sema::ParseAST to pass a
TranslationUnit object instead of an ASTContext. By default it calls
Initialize(ASTConstext& Context) (to match with the current interface used by
most ASTConsumers).

Modified the ObjC-Rewriter to use InitializeTU, and to tell the TranslationUnit
to not free its Decls.  This is a workaround for: <rdar://problem/5966749>

llvm-svn: 51825
2008-05-31 20:11:04 +00:00
Steve Naroff cd92aebd1f Fix <rdar://problem/5917992> clang ObjC rewriter: #end from #if statement lost in translation.
Some fancy footwork to accommodate embedded preprocessor directives within an interface.

llvm-svn: 51815
2008-05-31 14:15:04 +00:00
Steve Naroff 930e099b90 Fix <rdar://problem/5969777> clang ObjC rewriter: #imported file name mysteriously commented out
This fix involved tightening up needToScanForQualifiers(), which predated ObjCQualifiedIdType.
It also includes a minor tweak to the code that searches for the beginning of the qualified type. If the AST contained the correct beginning of the declaration (i.e. the beginning of the declaration specifiers), this code would be more robust. Since it doesn't, we apply an adhoc heuristic. Note that DeclSpec contains this info...we just don't propagate it to the AST (at present).

llvm-svn: 51812
2008-05-31 05:02:17 +00:00
Steve Naroff a6141f0780 Hack RewriteObjC::RewriteObjCStringLiteral() to include the filename in the generated code (replacing any non-alphanumeric characters with "_"). This allows header files to contain ObjCStringLiterals.
llvm-svn: 51811
2008-05-31 03:35:42 +00:00
Chris Lattner 34873d2134 give location info to another paren expr.
llvm-svn: 51646
2008-05-28 16:38:23 +00:00
Chris Lattner 37f5b7d39c minor changes, collect the range of an expr before rewriting the subexprs
no functionality change.

llvm-svn: 51497
2008-05-23 20:40:52 +00:00
Dan Gohman 1627ae7c48 Explicitly #include Support/Streams.h when using llvm::cout and friends.
llvm-svn: 51391
2008-05-21 20:19:16 +00:00
Steve Naroff ad91868aa6 Fix rewriter bug <rdar://problem/5929344> clang ObjC rewriter: "extern int __CFConstantStringClassReference[];" should be extern "C".
Have clang predefine OBJC_NEW_PROPERTIES (which is what gcc does).

llvm-svn: 51163
2008-05-15 21:12:10 +00:00
Steve Naroff d30f8c5b54 Fix <rdar://problem/5924225> clang ObjC rewriter: objc_exception_throw declaration in preamble does not match objc/objc-exception.h.
llvm-svn: 50915
2008-05-09 21:17:56 +00:00
Steve Naroff 2e4e385a58 Make sure the prototype for objc_msgSend_fpret() returns a double.
llvm-svn: 50873
2008-05-08 22:02:18 +00:00
Steve Naroff b1c02371cd Fix <rdar://problem/5879237> clang objc rewriter: ivars not accessible in structure generated for class
llvm-svn: 50862
2008-05-08 17:52:16 +00:00
Steve Naroff 30ac2225ee Fix <rdar://problem/5887874> clang ObjC rewriter: Use a different name for 'offsetof' macro
llvm-svn: 50832
2008-05-07 21:23:49 +00:00
Steve Naroff cab93d58c3 Fix <rdar://problem/5908598> clang ObjC rewriter: typo in #pragma at end
llvm-svn: 50790
2008-05-07 00:06:16 +00:00
Steve Naroff 29ce4e5d78 Fix <rdar://problem/5879237> clang objc rewriter: ivars not accessible in structure generated for class
llvm-svn: 50781
2008-05-06 23:20:07 +00:00
Steve Naroff ac81a5aad5 Fix <rdar://problem/5888515> clang ObjC rewriter: Use objc.h for declarations instead of putting them in the preamble?
llvm-svn: 50774
2008-05-06 22:45:19 +00:00
Steve Naroff 13e74879b0 Fix <rdar://problem/5881225> clang ObjC Rewriter: Protocol structure defined twice when two interfaces use it in same file
llvm-svn: 50767
2008-05-06 18:26:51 +00:00
Steve Naroff 472cf88ef2 Remove bogus cast (<rdar://problem/5874848> clang objc-rewriter: structure with list of protocols has wrong cast).
llvm-svn: 49935
2008-04-18 22:15:15 +00:00
Steve Naroff 24840f6748 Implement FIXME discoved by <rdar://problem/5874876> Rewriter: Explicit ivar refs outside a method are being rewritten
llvm-svn: 49932
2008-04-18 21:55:08 +00:00
Steve Naroff dcdcdcdfef Fix <rdar://problem/5874697> Rewriter: method arguments with complex types not being rewritten properly.
llvm-svn: 49925
2008-04-18 21:13:19 +00:00
Argyrios Kyrtzidis c3b69ae815 Addition of TranslationUnitDecl to the AST:
-Added TranslationUnitDecl class to serve as top declaration context
-ASTContext gets a TUDecl member and a getTranslationUnitDecl() function
-All ScopedDecls get the TUDecl as DeclContext when declared at global scope

llvm-svn: 49855
2008-04-17 14:40:12 +00:00
Steve Naroff 08899ff85d Remove FileVarDecl and BlockVarDecl. They are replaced by VarDecl::isBlockVarDecl() and VarDecl::isFileVarDecl().
This is a fairly mechanical/large change. As a result, I avoided making any changes/simplifications that weren't directly related. I did break two Analysis tests. I also have a couple FIXME's in UninitializedValues.cpp. Ted, can you take a look? If the bug isn't obvious, I am happy to dig in and fix it (since I broke it).

llvm-svn: 49748
2008-04-15 22:42:06 +00:00
Steve Naroff c5e5b38a8f Remove bogus token...
llvm-svn: 49695
2008-04-14 22:53:48 +00:00
Steve Naroff a8f0d12e81 Rename a file and update the Xcode project.
llvm-svn: 49693
2008-04-14 22:05:54 +00:00