Fix a bug where we would delete neccesary calls in bu pass
authorChris Lattner <sabre@nondot.org>
Sat, 1 Feb 2003 06:54:31 +0000 (06:54 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 1 Feb 2003 06:54:31 +0000 (06:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5465 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/DataStructure.cpp

index 2c9a75c9a858022723ebdf6bc1c2eaec74ab0aa4..bf7ec77f0ffcc68b05f281191eca5e4550f73ea1 100644 (file)
@@ -1058,7 +1058,8 @@ void DSGraph::removeDeadNodes(unsigned Flags) {
 
   std::vector<bool> AuxFCallsAlive(AuxFunctionCalls.size());
   for (unsigned i = 0, e = AuxFunctionCalls.size(); i != e; ++i)
-    if (CallSiteUsesAliveArgs(AuxFunctionCalls[i], Alive, Visited)) {
+    if (!(Flags & DSGraph::RemoveUnreachableGlobals) ||
+        CallSiteUsesAliveArgs(AuxFunctionCalls[i], Alive, Visited)) {
       AuxFunctionCalls[i].markReachableNodes(Alive);
       AuxFCallsAlive[i] = true;
     }