Duncan pointed out that the Extended case in getTypeForMVT could
[oota-llvm.git] / lib / VMCore / Module.cpp
index 893a5fdcb00d640a5f52b288a8ce4b45688f04a5..b95f6e3fa8661fd2a95773ebe7a260a465394234 100644 (file)
@@ -88,11 +88,6 @@ Module::~Module() {
   delete TypeSymTab;
 }
 
-// Module::dump() - Allow printing from debugger
-void Module::dump() const {
-  print(*cerr.stream());
-}
-
 /// Target endian information...
 Module::Endianness Module::getEndianness() const {
   std::string temp = DataLayout;
@@ -156,10 +151,12 @@ Constant *Module::getOrInsertFunction(const std::string &Name,
 
   // Okay, the function exists.  Does it have externally visible linkage?
   if (F->hasInternalLinkage()) {
-    // Rename the function.
-    F->setName(SymTab.getUniqueName(F->getName()));
+    // Clear the function's name.
+    F->setName("");
     // Retry, now there won't be a conflict.
-    return getOrInsertFunction(Name, Ty);
+    Constant *NewF = getOrInsertFunction(Name, Ty);
+    F->setName(&Name[0], Name.size());
+    return NewF;
   }
 
   // If the function exists but has the wrong type, return a bitcast to the