llvm.org GIT mirror llvm / 8c5c22f
Fix PR2029 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47129 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 11 years ago
2 changed file(s) with 25 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
255255 SwitchInst *CatchSwitch) {
256256 ConstantInt *InvokeNoC = ConstantInt::get(Type::Int32Ty, InvokeNo);
257257
258 // If the unwind edge has phi nodes, split the edge.
259 if (isa(II->getUnwindDest()->begin())) {
260 SplitCriticalEdge(II, 1, this);
261
262 // If there are any phi nodes left, they must have a single predecessor.
263 while (PHINode *PN = dyn_cast(II->getUnwindDest()->begin())) {
264 PN->replaceAllUsesWith(PN->getIncomingValue(0));
265 PN->eraseFromParent();
266 }
267 }
268
258269 // Insert a store of the invoke num before the invoke and store zero into the
259270 // location afterward.
260271 new StoreInst(InvokeNoC, InvokeNum, true, II); // volatile
0 ; RUN: llvm-as < %s | opt -lowerinvoke -enable-correct-eh-support -disable-output
1 ; PR2029
2 define i32 @main(i32 %argc, i8** %argv) {
3 bb470:
4 invoke i32 @main(i32 0, i8** null) to label %invcont474 unwind label
5 %lpad902
6
7 invcont474: ; preds = %bb470
8 ret i32 0
9
10 lpad902: ; preds = %bb470
11 %tmp471.lcssa = phi i8* [ null, %bb470 ] ;
12 ret i32 0
13 }