Fix PR820 and Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll

llvm-svn: 29071
This commit is contained in:
Chris Lattner 2006-07-07 21:37:01 +00:00
parent c20367a548
commit fd2e13b107
1 changed files with 3 additions and 0 deletions

View File

@ -1450,6 +1450,9 @@ static bool EvaluateFunction(Function *F, Constant *&RetVal,
AI->getName()));
InstResult = AllocaTmps.back();
} else if (CallInst *CI = dyn_cast<CallInst>(CurInst)) {
// Cannot handle inline asm.
if (isa<InlineAsm>(CI->getOperand(0))) return false;
// Resolve function pointers.
Function *Callee = dyn_cast<Function>(getVal(Values, CI->getOperand(0)));
if (!Callee) return false; // Cannot resolve.