aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-02-05 17:51:33 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-02-05 17:51:33 +0000
commit027627115ca1c486e420db7cd8439f25531135bb (patch)
tree75d00dedbfd3e0560594700f302c1503ff697d29 /lib/CodeGen/CGExpr.cpp
parent376338a68d467f076c2ae5fa614ec0286ea74d7c (diff)
IRgen: Use hasAggregateLLVMType instead of isSingleValueType() for cases that
need to deal with aggregates specially; this is consistent with the rest of IRgen. Also, simplify EmitParmDecl and don't worry about using Decl::getNameAsString. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95393 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r--lib/CodeGen/CGExpr.cpp5
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);
}