aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-02-05 21:10:36 +0000
committerDouglas Gregor <dgregor@apple.com>2010-02-05 21:10:36 +0000
commita5002106fbe5563aa59eba007416074d5b1ffecf (patch)
tree2d5f2f7c66a8ed20872b604b10572e71fdcbd342 /lib/CodeGen/CGExpr.cpp
parent4794081837ba088965a71652a46494ef4c6b2590 (diff)
Revert r95393, which broke Clang's self-host.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95430 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r--lib/CodeGen/CGExpr.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 2684eb6e3c..7fb79e9585 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -549,13 +549,14 @@ 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 (!CodeGenFunction::hasAggregateLLVMType(ExprType))
+ if (EltTy->isSingleValueType())
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);
}