diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2010-09-18 20:47:25 +0000 | 
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-09-18 20:47:25 +0000 | 
| commit | 4fbf4af0f6131dba175c1e5992cac8613aafc9ef (patch) | |
| tree | 317822a270201b0e7faabccfb3485389ffbd8c46 /clang/lib/CodeGen | |
| parent | ea639aa11f162437e7f036d43159173c6289e89c (diff) | |
| download | bcm5719-llvm-4fbf4af0f6131dba175c1e5992cac8613aafc9ef.tar.gz bcm5719-llvm-4fbf4af0f6131dba175c1e5992cac8613aafc9ef.zip | |
Fixes IRgen bug in objc++ reference binding of a
getter expression. 
Fixes // rdar://8437240
llvm-svn: 114299
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 10 | 
1 files changed, 9 insertions, 1 deletions
| diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index 924ca3ec4bb..9b69297bbed 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -196,7 +196,15 @@ EmitExprForReferenceBinding(CodeGenFunction &CGF, const Expr *E,    if (E->isLvalue(CGF.getContext()) == Expr::LV_Valid) {      // Emit the expression as an lvalue.      LValue LV = CGF.EmitLValue(E); - +    if (LV.isPropertyRef() || LV.isKVCRef()) { +      QualType QT = E->getType(); +      RValue RV =  +        LV.isPropertyRef() ? CGF.EmitLoadOfPropertyRefLValue(LV, QT)  +                           : CGF.EmitLoadOfKVCRefLValue(LV, QT); +      assert(RV.isScalar() && "EmitExprForReferenceBinding"); +      return RV.getScalarVal(); +    } +          if (LV.isSimple())        return LV.getAddress(); | 

