[vmkit-commits] [vmkit] r58325 - /vmkit/trunk/lib/JnJVM/VMCore/LowerConstantCalls.cpp
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Tue Oct 28 04:47:02 PDT 2008
Author: geoffray
Date: Tue Oct 28 06:47:00 2008
New Revision: 58325
URL: http://llvm.org/viewvc/llvm-project?rev=58325&view=rev
Log:
Change the PHI nodes of a normal dest when the changed instruction
is an InvokeInst.
Modified:
vmkit/trunk/lib/JnJVM/VMCore/LowerConstantCalls.cpp
Modified: vmkit/trunk/lib/JnJVM/VMCore/LowerConstantCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/LowerConstantCalls.cpp?rev=58325&r1=58324&r2=58325&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/LowerConstantCalls.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/LowerConstantCalls.cpp Tue Oct 28 06:47:00 2008
@@ -278,6 +278,16 @@
PHI->addIncoming(Val, falseCl);
Temp++;
}
+
+ // And here we set the phi nodes of the normal dest of the Invoke
+ // instruction. The phi nodes have now the trueCl as basic block.
+ Temp = NBB->getInstList().begin();
+ while (PHINode* PHI = dyn_cast<PHINode>(Temp)) {
+ Value* Val = PHI->getIncomingValueForBlock(CI->getParent());
+ PHI->removeIncomingValue(CI->getParent(), false);
+ PHI->addIncoming(Val, trueCl);
+ Temp++;
+ }
} else {
res = CallInst::Create(module->InitialiseClassFunction,
Args.begin(), Args.end(), "",
@@ -351,6 +361,17 @@
PHI->addIncoming(Val, falseCl);
Temp++;
}
+
+ // And here we set the phi nodes of the normal dest of the Invoke
+ // instruction. The phi nodes have now the trueCl as basic block.
+ Temp = NBB->getInstList().begin();
+ while (PHINode* PHI = dyn_cast<PHINode>(Temp)) {
+ Value* Val = PHI->getIncomingValueForBlock(CI->getParent());
+ PHI->removeIncomingValue(CI->getParent(), false);
+ PHI->addIncoming(Val, trueCl);
+ Temp++;
+ }
+
} else {
res = CallInst::Create(resolver, Args.begin(), Args.end(), "",
falseCl);
More information about the vmkit-commits
mailing list