[cfe-commits] r62004 - /cfe/trunk/lib/CodeGen/CGExpr.cpp
Daniel Dunbar
daniel at zuster.org
Fri Jan 9 12:09:28 PST 2009
Author: ddunbar
Date: Fri Jan 9 14:09:28 2009
New Revision: 62004
URL: http://llvm.org/viewvc/llvm-project?rev=62004&view=rev
Log:
Implement EmitUnsupportedRValue to generate an appropriately typed RValue.
Modified:
cfe/trunk/lib/CodeGen/CGExpr.cpp
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=62004&r1=62003&r2=62004&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Fri Jan 9 14:09:28 2009
@@ -86,8 +86,18 @@
RValue CodeGenFunction::EmitUnsupportedRValue(const Expr *E,
const char *Name) {
ErrorUnsupported(E, Name);
- llvm::Type *Ty = llvm::PointerType::getUnqual(ConvertType(E->getType()));
- return RValue::get(llvm::UndefValue::get(Ty));
+ if (const ComplexType *CTy = E->getType()->getAsComplexType()) {
+ const llvm::Type *EltTy = ConvertType(CTy->getElementType());
+ llvm::Value *U = llvm::UndefValue::get(EltTy);
+ return RValue::getComplex(std::make_pair(U, U));
+ } else if (hasAggregateLLVMType(E->getType())) {
+ const llvm::Type *Ty =
+ llvm::PointerType::getUnqual(ConvertType(E->getType()));
+ return RValue::getAggregate(llvm::UndefValue::get(Ty));
+ } else {
+ const llvm::Type *Ty = ConvertType(E->getType());
+ return RValue::get(llvm::UndefValue::get(Ty));
+ }
}
LValue CodeGenFunction::EmitUnsupportedLValue(const Expr *E,
@@ -911,7 +921,7 @@
return EmitBuiltinExpr(builtinID, E);
if (E->getCallee()->getType()->isBlockPointerType())
- return EmitUnsupportedRValue(E->getCallee(), "block pointer reference");
+ return EmitUnsupportedRValue(E, "block pointer reference");
llvm::Value *Callee = EmitScalarExpr(E->getCallee());
return EmitCallExpr(Callee, E->getCallee()->getType(),
More information about the cfe-commits
mailing list