tolerate unimplemented codegen better


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41424 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CodeGen/CGExpr.cpp b/CodeGen/CGExpr.cpp
index dbb7029..9256a5d 100644
--- a/CodeGen/CGExpr.cpp
+++ b/CodeGen/CGExpr.cpp
@@ -211,11 +211,12 @@
 ///
 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<DeclRefExpr>(E));
   case Expr::ParenExprClass:return EmitLValue(cast<ParenExpr>(E)->getSubExpr());