From 7013c8c2f878026d5f05975c4a2ee5c92e606a7b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 26 Aug 2007 05:06:40 +0000 Subject: [PATCH] tolerate unimplemented codegen better git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41424 91177308-0d34-0410-b5e6-96231b3b80d8 --- CodeGen/CGExpr.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CodeGen/CGExpr.cpp b/CodeGen/CGExpr.cpp index dbb7029272..9256a5d773 100644 --- a/CodeGen/CGExpr.cpp +++ b/CodeGen/CGExpr.cpp @@ -211,11 +211,12 @@ llvm::Value *CodeGenFunction::ConvertScalarValueToBool(RValue Val, QualType Ty){ /// LValue CodeGenFunction::EmitLValue(const Expr *E) { switch (E->getStmtClass()) { - default: + default: { fprintf(stderr, "Unimplemented lvalue expr!\n"); E->dump(); - return LValue::MakeAddr(llvm::UndefValue::get( - llvm::PointerType::get(llvm::Type::Int32Ty))); + llvm::Type *Ty = llvm::PointerType::get(ConvertType(E->getType())); + return LValue::MakeAddr(llvm::UndefValue::get(Ty)); + } case Expr::DeclRefExprClass: return EmitDeclRefLValue(cast(E)); case Expr::ParenExprClass:return EmitLValue(cast(E)->getSubExpr()); -- 2.40.0