aboutsummaryrefslogtreecommitdiff
path: root/Driver/RewriteObjC.cpp
AgeCommit message (Collapse)Author
2008-08-08Unbreak SerializationTest and the Rewriter by doing the work in ↵Ted Kremenek
HandleTranslationUnit instead of the destructor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54513 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06Fix for <rdar://problem/6113807> clang ObjC rewriter: crash rewriting ↵Steve Naroff
attached file While this is a safe rewriter fix, there is still a need for some discussion (see report for more info). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54412 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05Finish fixing <rdar://problem/5929344> clang ObjC rewriter: "extern int ↵Steve Naroff
__CFConstantStringClassReference[];" should be extern "C" git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54367 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05Fix <rdar://problem/6108119> clang ObjC rewriter: if no newline at end of ↵Steve Naroff
input file, rewriter inserts #define on same line as closing brace git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54363 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-29Fix incomplete implementation for rewriting protocol refs.Steve Naroff
<rdar://problem/6108127> clang ObjC rewriter: no translation of id <proto> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54163 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-26remove some unneeded calls to getCanonicalTypeChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54106 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25Fix RewriteObjC::RewriteObjCThrowStmt() to respect whitespace between the @ ↵Steve Naroff
and throw. This fixes <rdar://problem/5988388> clang ObjC rewriter: mystery 'w' inserted in exception throw. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54017 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-24Fix Sema::ActOnClassMessage() to pass through the identifier for "super". Steve Naroff
This fixes a critical rewriter bug (<rdar://problem/6096760> clang ObjC rewriter: 'self' not expected value in class method called with 'super'). Also added a couple FIXME's since I'm not happy with my fix to Sema. It would be nicer if the super handling for class/instance messages was the same (based on PreDefinedExpr). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53994 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21unindent this function by using an early exit, not functionality change.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53877 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21move two more lists of protocols over to use ObjCList<ObjCProtocolDecl>,Chris Lattner
simplifying code along the way and fixing a problem and memory leak or two. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53876 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21RewriteObjC::RewriteObjCForCollectionStmt() needs to handle bodies with a ↵Steve Naroff
single statement. Fixes <rdar://problem/6084870> clang ObjC rewriter: for-in enumeration in 1 line produces output with error. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53858 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21introduce a new ObjCList templated class and start moving Chris Lattner
various objc lists over to it. First up, the protocol list on ObjCInterfaceDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53856 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-16RewriteObjC::SynthMessageExpr(): Fix super rewrite (a fairly recent regression).Steve Naroff
Fixes <rdar://problem/6046663> clang ObjC rewriter: Regression in handling of 'super' in latest build. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53703 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-16Remove a FIXME from RewriteObjC::RewriteObjCSynchronizedStmt().Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53696 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-16RewriteObjC::Initialize(): add function decls used by @synchronized.Steve Naroff
This fixes <rdar://problem/6040143> clang ObjC rewriter: @synchronized keyword inserts undeclared objc functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53695 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-16Two fixes:Steve Naroff
- 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53694 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-16RewriteObjC::RewriteObjCTryStmt():Don't synthesize a catch begin if there ↵Steve Naroff
are 0 catch clauses. This fixes <rdar://problem/5987211> clang ObjC rewriter: @try / @finally block produces unbalanced output. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53679 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-16Teach RewriteObjC::RewriteObjCMethodDecl() to deal with pointer to function ↵Steve Naroff
return types. This fixes <rdar://problem/6034961> clang ObjC rewriter: rewriting methods with function pointer return values does not work git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53678 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-21Switch 'super' from being a weird cast thing to being a predefined expr node.Chris Lattner
Patch by David Chisnall with objc rewriter and stmtdumper updates from me. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52580 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-17Change self/_cmd to be instances of ImplicitParamDecl instead of ParmVarDecl.Chris Lattner
Patch by David Chisnall! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52422 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-09-Changes to TagDecl:Argyrios Kyrtzidis
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52160 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-02Fix <rdar://problem/5976164> clang ObjC rewriter: for ... in enumeration ↵Steve Naroff
inserts undeclared function (objc_enumerationMutation should be in preamble) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51880 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31Added "InitializeTU" to ASTConsumer. This is used by Sema::ParseAST to pass aTed Kremenek
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> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51825 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31Fix <rdar://problem/5917992> clang ObjC rewriter: #end from #if statement ↵Steve Naroff
lost in translation. Some fancy footwork to accommodate embedded preprocessor directives within an interface. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51815 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31Fix <rdar://problem/5969777> clang ObjC rewriter: #imported file name ↵Steve Naroff
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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51812 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31Hack RewriteObjC::RewriteObjCStringLiteral() to include the filename in the ↵Steve Naroff
generated code (replacing any non-alphanumeric characters with "_"). This allows header files to contain ObjCStringLiterals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51811 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-28give location info to another paren expr.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51646 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23minor changes, collect the range of an expr before rewriting the subexprsChris Lattner
no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51497 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21Explicitly #include Support/Streams.h when using llvm::cout and friends.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51391 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-15Fix rewriter bug <rdar://problem/5929344> clang ObjC rewriter: "extern int ↵Steve Naroff
__CFConstantStringClassReference[];" should be extern "C". Have clang predefine OBJC_NEW_PROPERTIES (which is what gcc does). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51163 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-09Fix <rdar://problem/5924225> clang ObjC rewriter: objc_exception_throw ↵Steve Naroff
declaration in preamble does not match objc/objc-exception.h. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50915 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08Make sure the prototype for objc_msgSend_fpret() returns a double.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50873 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08Fix <rdar://problem/5879237> clang objc rewriter: ivars not accessible in ↵Steve Naroff
structure generated for class git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50862 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07Fix <rdar://problem/5887874> clang ObjC rewriter: Use a different name for ↵Steve Naroff
'offsetof' macro git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50832 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07Fix <rdar://problem/5908598> clang ObjC rewriter: typo in #pragma at endSteve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50790 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06Fix <rdar://problem/5879237> clang objc rewriter: ivars not accessible in ↵Steve Naroff
structure generated for class git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50781 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06Fix <rdar://problem/5888515> clang ObjC rewriter: Use objc.h for ↵Steve Naroff
declarations instead of putting them in the preamble? git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50774 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06Fix <rdar://problem/5881225> clang ObjC Rewriter: Protocol structure defined ↵Steve Naroff
twice when two interfaces use it in same file git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50767 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-18Remove bogus cast (<rdar://problem/5874848> clang objc-rewriter: structure ↵Steve Naroff
with list of protocols has wrong cast). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49935 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-18Implement FIXME discoved by <rdar://problem/5874876> Rewriter: Explicit ivar ↵Steve Naroff
refs outside a method are being rewritten git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49932 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-18Fix <rdar://problem/5874697> Rewriter: method arguments with complex types ↵Steve Naroff
not being rewritten properly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49925 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-17Addition of TranslationUnitDecl to the AST:Argyrios Kyrtzidis
-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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49855 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15Remove FileVarDecl and BlockVarDecl. They are replaced by ↵Steve Naroff
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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49748 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14Remove bogus token...Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49695 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