projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f51bf96
)
Check the number of Args in LibCallsShrinkWrap.
author
Rong Xu
<xur@google.com>
Mon, 24 Oct 2016 16:50:12 +0000
(16:50 +0000)
committer
Rong Xu
<xur@google.com>
Mon, 24 Oct 2016 16:50:12 +0000
(16:50 +0000)
Some library fucntions can have no argument.
llvm-svn: 284989
llvm/lib/Transforms/Utils/LibCallsShrinkWrap.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Transforms/Utils/LibCallsShrinkWrap.cpp
b/llvm/lib/Transforms/Utils/LibCallsShrinkWrap.cpp
index
cf56a58
..
c992498
100644
(file)
--- a/
llvm/lib/Transforms/Utils/LibCallsShrinkWrap.cpp
+++ b/
llvm/lib/Transforms/Utils/LibCallsShrinkWrap.cpp
@@
-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() ||