diff options
author | Chris Lattner <sabre@nondot.org> | 2011-06-18 21:46:23 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-06-18 21:46:23 +0000 |
commit | 67733f65574a05ca45bb0908a97c1fdab672595b (patch) | |
tree | 9effbcf71aaee3ab9c1029cbf8ad570160a7888d /llvm/lib/Analysis | |
parent | 3a16c711bce07717486404955d6b7b77b981ea9e (diff) | |
download | bcm5719-llvm-67733f65574a05ca45bb0908a97c1fdab672595b.tar.gz bcm5719-llvm-67733f65574a05ca45bb0908a97c1fdab672595b.zip |
simplify some code.
llvm-svn: 133362
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/MemoryBuiltins.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/MemoryBuiltins.cpp b/llvm/lib/Analysis/MemoryBuiltins.cpp index 769c68ce425..53d43049119 100644 --- a/llvm/lib/Analysis/MemoryBuiltins.cpp +++ b/llvm/lib/Analysis/MemoryBuiltins.cpp @@ -50,13 +50,8 @@ static bool isMallocCall(const CallInst *CI) { const FunctionType *FTy = Callee->getFunctionType(); if (FTy->getNumParams() != 1) return false; - if (IntegerType *ITy = dyn_cast<IntegerType>(FTy->param_begin()->get())) { - if (ITy->getBitWidth() != 32 && ITy->getBitWidth() != 64) - return false; - return true; - } - - return false; + return FTy->getParamType(0)->isIntegerTy(32) || + FTy->getParamType(0)->isIntegerTy(64); } /// extractMallocCall - Returns the corresponding CallInst if the instruction @@ -211,7 +206,7 @@ const CallInst *llvm::isFreeCall(const Value *I) { return 0; if (FTy->getNumParams() != 1) return 0; - if (FTy->param_begin()->get() != Type::getInt8PtrTy(Callee->getContext())) + if (FTy->getParamType(0) != Type::getInt8PtrTy(Callee->getContext())) return 0; return CI; |