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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29071 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-07-07 21:37:01 +00:00
parent e89121be21
commit 7cd580f0b7

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.