summaryrefslogtreecommitdiff
path: root/lib/Analysis/MemoryBuiltins.cpp
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2012-06-22 00:25:01 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2012-06-22 00:25:01 +0000
commiteb7c6865cd8d44a882aa7c3e10e1d976f333344f (patch)
treebca5f7a0dabf590c9a399338d8b5d50c407b9a0e /lib/Analysis/MemoryBuiltins.cpp
parentf1fb6c836940d1b92c0e3df27f4c9ca6569ff968 (diff)
downloadllvm-eb7c6865cd8d44a882aa7c3e10e1d976f333344f.tar.gz
llvm-eb7c6865cd8d44a882aa7c3e10e1d976f333344f.tar.bz2
llvm-eb7c6865cd8d44a882aa7c3e10e1d976f333344f.tar.xz
remove extractMallocCallFromBitCast, since it was tailor maded for its sole user. Update GlobalOpt accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158952 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/MemoryBuiltins.cpp')
-rw-r--r--lib/Analysis/MemoryBuiltins.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/Analysis/MemoryBuiltins.cpp b/lib/Analysis/MemoryBuiltins.cpp
index 26d466ed31..d1a9363b41 100644
--- a/lib/Analysis/MemoryBuiltins.cpp
+++ b/lib/Analysis/MemoryBuiltins.cpp
@@ -170,14 +170,7 @@ bool llvm::isReallocLikeFn(const Value *V, bool LookThroughBitCast) {
/// is a malloc call. Since CallInst::CreateMalloc() only creates calls, we
/// ignore InvokeInst here.
const CallInst *llvm::extractMallocCall(const Value *I) {
- return isMallocLikeFn(I) ? cast<CallInst>(I) : 0;
-}
-
-/// extractMallocCallFromBitCast - Returns the corresponding CallInst if the
-/// instruction is a bitcast of the result of a malloc call.
-const CallInst *llvm::extractMallocCallFromBitCast(const Value *I) {
- const BitCastInst *BCI = dyn_cast<BitCastInst>(I);
- return BCI ? extractMallocCall(BCI->getOperand(0)) : 0;
+ return isMallocLikeFn(I) ? dyn_cast<CallInst>(I) : 0;
}
static Value *computeArraySize(const CallInst *CI, const TargetData *TD,