mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-02 00:51:56 +00:00
just for the hell of it, allow globalopt to statically evaluate
static constructors with indirect gotos :) llvm-svn: 85495
This commit is contained in:
parent
9bc4a421e2
commit
e83554145a
@ -2341,6 +2341,12 @@ static bool EvaluateFunction(Function *F, Constant *&RetVal,
|
||||
dyn_cast<ConstantInt>(getVal(Values, SI->getCondition()));
|
||||
if (!Val) return false; // Cannot determine.
|
||||
NewBB = SI->getSuccessor(SI->findCaseValue(Val));
|
||||
} else if (IndirectBrInst *IBI = dyn_cast<IndirectBrInst>(CurInst)) {
|
||||
Value *Val = getVal(Values, IBI->getAddress())->stripPointerCasts();
|
||||
if (BlockAddress *BA = dyn_cast<BlockAddress>(Val))
|
||||
NewBB = BA->getBasicBlock();
|
||||
else
|
||||
return false; // Cannot determine.
|
||||
} else if (ReturnInst *RI = dyn_cast<ReturnInst>(CurInst)) {
|
||||
if (RI->getNumOperands())
|
||||
RetVal = getVal(Values, RI->getOperand(0));
|
||||
|
Loading…
Reference in New Issue
Block a user