diff options
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 8880701455..427975deb1 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -549,14 +549,13 @@ RValue CodeGenFunction::EmitLoadOfLValue(LValue LV, QualType ExprType) { if (LV.isSimple()) { llvm::Value *Ptr = LV.getAddress(); - const llvm::Type *EltTy = - cast<llvm::PointerType>(Ptr->getType())->getElementType(); // Simple scalar l-value. - if (EltTy->isSingleValueType()) + if (!CodeGenFunction::hasAggregateLLVMType(ExprType)) return RValue::get(EmitLoadOfScalar(Ptr, LV.isVolatileQualified(), ExprType)); + // FIXME: This case shouldn't be necessary? assert(ExprType->isFunctionType() && "Unknown scalar value"); return RValue::get(Ptr); } |