forked from OSchip/llvm-project
Fixed an ir-gen bug in syntheszing a getter function
with property type which does not match its ivar and in -fobjc-gc-only mode! llvm-svn: 65955
This commit is contained in:
parent
5340b248b4
commit
eab5ecd8e0
|
@ -205,9 +205,13 @@ void CodeGenFunction::GenerateObjCGetter(ObjCImplementationDecl *IMP,
|
|||
if (hasAggregateLLVMType(Ivar->getType())) {
|
||||
EmitAggregateCopy(ReturnValue, LV.getAddress(), Ivar->getType());
|
||||
}
|
||||
else
|
||||
EmitReturnOfRValue(EmitLoadOfLValue(LV, Ivar->getType()),
|
||||
PD->getType());
|
||||
else {
|
||||
CodeGenTypes &Types = CGM.getTypes();
|
||||
RValue RV = EmitLoadOfLValue(LV, Ivar->getType());
|
||||
RV = RValue::get(Builder.CreateBitCast(RV.getScalarVal(),
|
||||
Types.ConvertType(PD->getType())));
|
||||
EmitReturnOfRValue(RV, PD->getType());
|
||||
}
|
||||
}
|
||||
|
||||
FinishFunction();
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
// RUN: clang -triple x86_64-unknown-unknown -fobjc-gc-only -emit-llvm -o %t %s
|
||||
|
||||
@interface I0 {
|
||||
I0 *_f0;
|
||||
}
|
||||
@property (retain) id p0;
|
||||
@end
|
||||
|
||||
@implementation I0
|
||||
@synthesize p0 = _f0;
|
||||
@end
|
||||
|
Loading…
Reference in New Issue