Check the number of Args in LibCallsShrinkWrap.

Some library fucntions can have no argument.

llvm-svn: 284989
This commit is contained in:
Rong Xu 2016-10-24 16:50:12 +00:00
parent f51bf96977
commit b05bac940d
1 changed files with 2 additions and 0 deletions

View File

@ -317,6 +317,8 @@ void LibCallsShrinkWrap::checkCandidate(CallInst &CI) {
if (!TLI.getLibFunc(*Callee, Func) || !TLI.has(Func))
return;
if (CI.getNumArgOperands() == 0)
return;
// TODO: Handle long double in other formats.
Type *ArgType = CI.getArgOperand(0)->getType();
if (!(ArgType->isFloatTy() || ArgType->isDoubleTy() ||