Use the expression map correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1140 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/LevelRaise.cpp b/lib/Transforms/LevelRaise.cpp
index 6883008..ccba32b 100644
--- a/lib/Transforms/LevelRaise.cpp
+++ b/lib/Transforms/LevelRaise.cpp
@@ -42,7 +42,7 @@
 
 #include "llvm/Assembly/Writer.h"
 
-#define DEBUG_PEEPHOLE_INSTS 1
+//#define DEBUG_PEEPHOLE_INSTS 1
 
 #ifdef DEBUG_PEEPHOLE_INSTS
 #define PRINT_PEEPHOLE(ID, NUM, I)            \
@@ -356,11 +356,8 @@
         PRINT_PEEPHOLE2("CAST-DEST-EXPR-CONV:in ", CI, Src);
 
         ValueMapCache ValueMap;
-        ConvertUsersType(CI, Src, ValueMap);
-        if (!Src->hasName() && CI->hasName()) {
-          string Name = CI->getName(); CI->setName("");
-          Src->setName(Name, BB->getParent()->getSymbolTable());
-        }
+        ConvertUsersType(CI, Src, ValueMap);  // This will delete CI!
+
         BI = BB->begin();  // Rescan basic block.  BI might be invalidated.
         PRINT_PEEPHOLE1("CAST-DEST-EXPR-CONV:out", I);
         return true;