Fix a fairly nasty bug that prevented bugpoint from working quite right when
authorChris Lattner <sabre@nondot.org>
Fri, 2 Apr 2004 06:30:33 +0000 (06:30 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 2 Apr 2004 06:30:33 +0000 (06:30 +0000)
hacking on programs with two functions that have the same name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12604 91177308-0d34-0410-b5e6-96231b3b80d8

tools/bugpoint/ExtractFunction.cpp

index 5119c801a024f368d8f1842c268b5808ae0e41cb..eea7bd8e2531b194177555a177bb0ad6f6c758da 100644 (file)
@@ -195,7 +195,9 @@ Module *llvm::SplitFunctionsOutOfModule(Module *M,
     bool funcFound = false;
     for (std::vector<Function*>::const_iterator FI = F.begin(), Fe = F.end();
          FI != Fe; ++FI)
-      if (I->getName() == (*FI)->getName()) funcFound = true;
+      if (I->getName() == (*FI)->getName() &&
+          I->getType() == (*FI)->getType())
+        funcFound = true;
 
     if (!funcFound)
       DeleteFunctionBody(I);