[llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Apr 12 12:08:34 PDT 2005



Changes in directory llvm-poolalloc/lib/PoolAllocate:

TransformFunctionBody.cpp updated: 1.43 -> 1.44
---
Log message:

Fix problems handling invoke instructions that prevented the pool allocator
from working on 176.gcc


---
Diffs of the changes:  (+18 -0)

 TransformFunctionBody.cpp |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+)


Index: llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp
diff -u llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.43 llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.44
--- llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.43	Sat Apr  2 14:10:57 2005
+++ llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp	Tue Apr 12 14:08:18 2005
@@ -172,6 +172,12 @@
     UpdateNewToOldValueMap(I, V, V != Casted ? Casted : 0);
   }
 
+  // If this was an invoke, fix up the CFG.
+  if (InvokeInst *II = dyn_cast<InvokeInst>(I)) {
+    new BranchInst(II->getNormalDest(), I);
+    II->getUnwindDest()->removePredecessor(II->getParent(), true);
+  }
+
   // Remove old allocation instruction.
   I->eraseFromParent();
   return Casted;
@@ -305,6 +311,12 @@
     UpdateNewToOldValueMap(I, V, V != Casted ? Casted : 0);
   }
 
+  // If this was an invoke, fix up the CFG.
+  if (InvokeInst *II = dyn_cast<InvokeInst>(I)) {
+    new BranchInst(II->getNormalDest(), I);
+    II->getUnwindDest()->removePredecessor(II->getParent(), true);
+  }
+
   // Remove old allocation instruction.
   I->eraseFromParent();
 }
@@ -370,6 +382,12 @@
     UpdateNewToOldValueMap(I, V, V != Casted ? Casted : 0);
   }
 
+  // If this was an invoke, fix up the CFG.
+  if (InvokeInst *II = dyn_cast<InvokeInst>(I)) {
+    new BranchInst(II->getNormalDest(), I);
+    II->getUnwindDest()->removePredecessor(II->getParent(), true);
+  }
+
   // Remove old allocation instruction.
   I->eraseFromParent();
 }






More information about the llvm-commits mailing list