diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-03-03 18:49:40 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-03-03 18:49:40 +0000 |
commit | eab5ecd8e091169741d8a0b8fa7e30886334668b (patch) | |
tree | 1ccce5206439a098f233bc1dbf492341b40f8c6c /clang/lib/CodeGen/CGObjC.cpp | |
parent | 5340b248b4a72e608d72bf2b84c6e133c2334aa3 (diff) | |
download | bcm5719-llvm-eab5ecd8e091169741d8a0b8fa7e30886334668b.tar.gz bcm5719-llvm-eab5ecd8e091169741d8a0b8fa7e30886334668b.zip |
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
Diffstat (limited to 'clang/lib/CodeGen/CGObjC.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGObjC.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp index cebaa1eb030..57988650774 100644 --- a/clang/lib/CodeGen/CGObjC.cpp +++ b/clang/lib/CodeGen/CGObjC.cpp @@ -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(); |