Hi Fariborz, Is it possible to write this test to actually check the output LLVM IR to make sure that whatever error was fixed, is fixed?
- Daniel On Wed, Mar 3, 2010 at 2:09 PM, Fariborz Jahanian <[email protected]> wrote: > Author: fjahanian > Date: Wed Mar 3 16:09:47 2010 > New Revision: 97672 > > URL: http://llvm.org/viewvc/llvm-project?rev=97672&view=rev > Log: > Fix code gen bug generating code for > ((id)cat)->isa. Fixes radar 7709015. > > > Modified: > cfe/trunk/lib/CodeGen/CGExprScalar.cpp > cfe/trunk/test/CodeGenObjC/id-isa-codegen.m > > Modified: cfe/trunk/lib/CodeGen/CGExprScalar.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprScalar.cpp?rev=97672&r1=97671&r2=97672&view=diff > ============================================================================== > --- cfe/trunk/lib/CodeGen/CGExprScalar.cpp (original) > +++ cfe/trunk/lib/CodeGen/CGExprScalar.cpp Wed Mar 3 16:09:47 2010 > @@ -1888,6 +1888,8 @@ > V = CreateTempAlloca(ClassPtrTy, "resval"); > llvm::Value *Src = EmitScalarExpr(BaseExpr); > Builder.CreateStore(Src, V); > + LValue LV = LValue::MakeAddr(V, MakeQualifiers(E->getType())); > + V = ScalarExprEmitter(*this).EmitLoadOfLValue(LV, E->getType()); > } > else { > if (E->isArrow()) > > Modified: cfe/trunk/test/CodeGenObjC/id-isa-codegen.m > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/id-isa-codegen.m?rev=97672&r1=97671&r2=97672&view=diff > ============================================================================== > --- cfe/trunk/test/CodeGenObjC/id-isa-codegen.m (original) > +++ cfe/trunk/test/CodeGenObjC/id-isa-codegen.m Wed Mar 3 16:09:47 2010 > @@ -1,4 +1,4 @@ > -// RUN: %clang_cc1 -emit-llvm -o %t %s > +// RUN: %clang_cc1 -emit-llvm -o - %s > > typedef struct objc_class *Class; > > @@ -48,3 +48,19 @@ > return (*[Foo method]).isa; > return [Foo method]->isa; > } > + > +// rdar 7709015 > +...@interface Cat {} > +...@end > + > +...@interface SuperCat : Cat {} > ++(void)geneticallyAlterCat:(Cat *)cat; > +...@end > + > +...@implementation SuperCat > ++ (void)geneticallyAlterCat:(Cat *)cat { > + Class dynamicSubclass; > + ((id)cat)->isa = dynamicSubclass; > +} > +...@end > + > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits > _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
