[cfe-dev] Two GNU runtime fixes

David Chisnall csdavec at swansea.ac.uk
Sun May 17 04:24:21 PDT 2009


Thanks Daniel,

This regression was caused by the fact that I added references to  
property set/get methods without checking whether they were actually  
implemented.  I've updated the diff so that it now tests this.

I've also addressed the FIXME in this test; the GNU back end can now  
handle all of the syntax in the included file, so the -D line is not  
required.

With the attached version of the diff, all relevant tests now pass for  
me.

David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang.diff
Type: application/octet-stream
Size: 4582 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090517/d0de95d7/attachment.obj>
-------------- next part --------------


On 16 May 2009, at 20:31, Daniel Dunbar wrote:

> Hi David,
>
> codegen-gnu.m seems to be failing for me now with this applied
> (whereas it was silently passing, but crashing, before):
> --
> ddunbar at 67-218-102-166:Coverage$ ../TestRunner.sh codegen-gnu.m
> ******************** TEST 'codegen-gnu.m' FAILED! ********************
> Command:
> /Users/ddunbar/bin/clang-cc -triple i386-unknown-unknown
> -DIRGENABLE_GNU -DIRGENABLE -fgnu-runtime -emit-llvm -o
> Output/codegen-gnu.m.out.tmp codegen-gnu.m &&
> /Users/ddunbar/bin/clang-cc -triple i386-unknown-unknown
> -DIRGENABLE_GNU -DIRGENABLE -g -fgnu-runtime -emit-llvm -o
> Output/codegen-gnu.m.out.tmp codegen-gnu.m &&
> not /Users/ddunbar/bin/clang-cc -triple i386-unknown-unknown
> -fgnu-runtime -emit-llvm -o Output/codegen-gnu.m.out.tmp codegen-gnu.m
> Incorrect Output:
> In file included from codegen-gnu.m:7:
> ./objc-language-features.inc:30:3: warning: method '+fm0' not found
> (return type defaults to 'id')
>  [super fm0];
>  ^~~~~~~~~~~
> ./objc-language-features.inc:36:3: warning: method '-im0' not found
> (return type defaults to 'id')
>  [super im0];
>  ^~~~~~~~~~~
> ./objc-language-features.inc:21:20: warning: property 'p2' requires
> method 'p2' to be defined - use @synthesize, @dynamic or provide a
> method implementation
> @property(copy) id p2;
>                   ^
> ./objc-language-features.inc:26:1: note: implementation is here
> @implementation A
> ^
> ./objc-language-features.inc:21:20: warning: property 'p2' requires
> method 'setP2:' to be defined - use @synthesize, @dynamic or provide a
> method implementation
> @property(copy) id p2;
>                   ^
> ./objc-language-features.inc:26:1: note: implementation is here
> @implementation A
> ^
> ./objc-language-features.inc:22:22: warning: property 'p3' requires
> method 'p3' to be defined - use @synthesize, @dynamic or provide a
> method implementation
> @property(retain) id p3;
>                     ^
> ./objc-language-features.inc:26:1: note: implementation is here
> @implementation A
> ^
> ./objc-language-features.inc:22:22: warning: property 'p3' requires
> method 'setP3:' to be defined - use @synthesize, @dynamic or provide a
> method implementation
> @property(retain) id p3;
>                     ^
> ./objc-language-features.inc:26:1: note: implementation is here
> @implementation A
> ^
> ./objc-language-features.inc:23:51: warning: property 'p4' requires
> method 'getme' to be defined - use @synthesize, @dynamic or provide a
> method implementation
> @property(assign, getter=getme, setter=setme:) id p4;
>                                                  ^
> ./objc-language-features.inc:26:1: note: implementation is here
> @implementation A
> ^
> ./objc-language-features.inc:23:51: warning: property 'p4' requires
> method 'setme:' to be defined - use @synthesize, @dynamic or provide a
> method implementation
> @property(assign, getter=getme, setter=setme:) id p4;
>                                                  ^
> ./objc-language-features.inc:26:1: note: implementation is here
> @implementation A
> ^
> ./objc-language-features.inc:26:1: warning: incomplete implementation
> @implementation A
> ^
> ./objc-language-features.inc:26:1: warning: method definition for
> 'fm0' not found
> 0   clang-cc          0x0000000100b6480a PrintStackTrace(void*) + 38
> 1   clang-cc          0x0000000100b64d1a SignalHandler(int) + 288
> 2   libSystem.B.dylib 0x00007fff886bb58a _sigtramp + 26
> 3   clang-cc          0x000000010064f993 std::vector<llvm::Constant*,
> std::allocator<llvm::Constant*> >::~vector() + 75
> 4   clang-cc          0x0000000100690071 llvm::PATypeHolder::operator
> llvm::Type*() const + 21
> 5   clang-cc          0x000000010069008d llvm::Value::getType()  
> const + 25
> 6   clang-cc          0x0000000100a90c08
> llvm::ConstantExpr::getBitCast(llvm::Constant*, llvm::Type const*) +
> 26
> 7   clang-cc          0x00000001000c4bc1 (anonymous
> namespace)::CGObjCGNU::GenerateMethodList(std::string const&,
> std::string const&, llvm::SmallVectorImpl<clang::Selector> const&,
> llvm::SmallVectorImpl<llvm::Constant*> const&, bool) + 647
> 8   clang-cc          0x00000001000c942e (anonymous
> namespace)::CGObjCGNU::GenerateClass(clang::ObjCImplementationDecl
> const*) + 2170
> 9   clang-cc          0x00000001000fb40c
> clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 674
> 10  clang-cc          0x000000010010ca64 (anonymous
> namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
> + 76
> 11  clang-cc          0x0000000100036125 (anonymous
> namespace)::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) +
> 139
> 12  clang-cc          0x00000001001cc3ac
> clang::ParseAST(clang::Preprocessor&, clang::ASTConsumer*,
> clang::ASTContext&, bool, bool) + 478
> 13  clang-cc          0x0000000100076f53
> ProcessInputFile(clang::Preprocessor&, clang::PreprocessorFactory&,
> std::string const&, ProgActions, llvm::StringMap<bool,
> llvm::MallocAllocator> const&) + 2414
> 14  clang-cc          0x0000000100078417 main + 2237
> 15  clang-cc          0x0000000100027dbc start + 52
> 16  clang-cc          0x000000000000000a start + 4294804098
> Stack dump:
> 0.	Program arguments: /Users/ddunbar/bin/clang-cc -triple
> i386-unknown-unknown -DIRGENABLE_GNU -DIRGENABLE -fgnu-runtime
> -emit-llvm -o Output/codegen-gnu.m.out.tmp codegen-gnu.m
> 1.	./objc-language-features.inc:43:1: current parser token '@'
> 2.	./objc-language-features.inc:26:1: LLVM IR generation of  
> declaration 'A'
> Output/codegen-gnu.m.out.script: line 3: 67587 Segmentation fault
> /Users/ddunbar/bin/clang-cc -triple i386-unknown-unknown
> -DIRGENABLE_GNU -DIRGENABLE -fgnu-runtime -emit-llvm -o
> Output/codegen-gnu.m.out.tmp codegen-gnu.m
> ******************** TEST 'codegen-gnu.m' FAILED! ********************
> --
>
> - Daniel
>
> On Sat, May 16, 2009 at 9:20 AM, David Chisnall  
> <csdavec at swansea.ac.uk> wrote:
>> Hi,
>>
>> This patch fixes two bugs in the GNU Objective-C runtime  
>> implementation.
>>  One is a case in rethrowing exceptions where the C types don't match
>> correctly (I already sent this patch to Daniel Dunbar, who found  
>> the bug, so
>> it may have already been committed).  The other fixes the case  
>> properties so
>> that the methods generated as property accessors are added to the  
>> class
>> structure correctly.
>>
>> David
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev



More information about the cfe-dev mailing list