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:
b0f48f9
)
Simplify code. No functionality change.
author
Jakub Staszak
<kubastaszak@gmail.com>
Thu, 7 Mar 2013 20:22:39 +0000
(20:22 +0000)
committer
Jakub Staszak
<kubastaszak@gmail.com>
Thu, 7 Mar 2013 20:22:39 +0000
(20:22 +0000)
llvm-svn: 176646
llvm/lib/Analysis/MemoryBuiltins.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Analysis/MemoryBuiltins.cpp
b/llvm/lib/Analysis/MemoryBuiltins.cpp
index
26a013f
..
a1eea1c
100644
(file)
--- a/
llvm/lib/Analysis/MemoryBuiltins.cpp
+++ b/
llvm/lib/Analysis/MemoryBuiltins.cpp
@@
-225,9
+225,9
@@
const CallInst *llvm::isArrayMalloc(const Value *I,
const CallInst *CI = extractMallocCall(I, TLI);
Value *ArraySize = computeArraySize(CI, TD, TLI);
- if (
ArraySize &&
-
ArraySize != ConstantInt::get(CI->getArgOperand(0)->getType(), 1
))
- return CI;
+ if (
ConstantInt *ConstSize = dyn_cast_or_null<ConstantInt>(ArraySize))
+
if (ConstSize->isOne(
))
+
return CI;
// CI is a non-array malloc or we can't figure out that it is an array malloc.
return 0;