aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-12-04 08:14:53 +0000
committerJohn McCall <rjmccall@apple.com>2010-12-04 08:14:53 +0000
commit0e800c9c20d1a658a91096c756c4a4a9e90264fc (patch)
tree7be31a9b8db7381808de7ee48736c6029c53840b /lib/CodeGen/CGExpr.cpp
parentabc56c726178fc7c8a3f45185768426a6e9d584e (diff)
Remove some defensive calls to EmitLoadOfPropertyRefLValue that shouldn't
be required, and then fix up some missing loads on overloaded-operator paths which that exposed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120896 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r--lib/CodeGen/CGExpr.cpp35
1 files changed, 3 insertions, 32 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 78605ba8b1..35ba2543ef 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -195,13 +195,6 @@ EmitExprForReferenceBinding(CodeGenFunction &CGF, const Expr *E,
if (E->isLValue()) {
// Emit the expression as an lvalue.
LValue LV = CGF.EmitLValue(E);
- if (LV.isPropertyRef()) {
- QualType QT = E->getType();
- RValue RV = CGF.EmitLoadOfPropertyRefLValue(LV);
- assert(RV.isScalar() && "EmitExprForReferenceBinding");
- return RV.getScalarVal();
- }
-
if (LV.isSimple())
return LV.getAddress();
@@ -1537,11 +1530,6 @@ LValue CodeGenFunction::EmitMemberExpr(const MemberExpr *E) {
const PointerType *PTy =
BaseExpr->getType()->getAs<PointerType>();
BaseQuals = PTy->getPointeeType().getQualifiers();
- } else if (ObjCPropertyRefExpr *PRE
- = dyn_cast<ObjCPropertyRefExpr>(BaseExpr->IgnoreParens())) {
- RValue RV = EmitLoadOfPropertyRefLValue(EmitObjCPropertyRefLValue(PRE));
- BaseValue = RV.getAggregateAddr();
- BaseQuals = BaseExpr->getType().getQualifiers();
} else {
LValue BaseLV = EmitLValue(BaseExpr);
if (BaseLV.isNonGC())
@@ -1771,17 +1759,8 @@ LValue CodeGenFunction::EmitCastLValue(const CastExpr *E) {
}
case CK_NoOp:
- if (!E->getSubExpr()->isRValue() || E->getType()->isRecordType()) {
- LValue LV = EmitLValue(E->getSubExpr());
- if (LV.isPropertyRef()) {
- QualType QT = E->getSubExpr()->getType();
- RValue RV = EmitLoadOfPropertyRefLValue(LV);
- assert(RV.isAggregate());
- llvm::Value *V = RV.getAggregateAddr();
- return MakeAddrLValue(V, QT);
- }
- return LV;
- }
+ if (!E->getSubExpr()->isRValue() || E->getType()->isRecordType())
+ return EmitLValue(E->getSubExpr());
// Fall through to synthesize a temporary.
case CK_LValueToRValue:
@@ -1843,15 +1822,7 @@ LValue CodeGenFunction::EmitCastLValue(const CastExpr *E) {
cast<CXXRecordDecl>(DerivedClassTy->getDecl());
LValue LV = EmitLValue(E->getSubExpr());
- llvm::Value *This;
- if (LV.isPropertyRef()) {
- QualType QT = E->getSubExpr()->getType();
- RValue RV = EmitLoadOfPropertyRefLValue(LV);
- assert (!RV.isScalar() && "EmitCastLValue");
- This = RV.getAggregateAddr();
- }
- else
- This = LV.getAddress();
+ llvm::Value *This = LV.getAddress();
// Perform the derived-to-base conversion
llvm::Value *Base =