summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/MemoryBuiltins.cpp4
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/MemoryBuiltins.cpp b/llvm/lib/Analysis/MemoryBuiltins.cpp
index 347a7ea7a8b..9695ae1dec2 100644
--- a/llvm/lib/Analysis/MemoryBuiltins.cpp
+++ b/llvm/lib/Analysis/MemoryBuiltins.cpp
@@ -182,7 +182,7 @@ Value *llvm::getMallocArraySize(CallInst *CI, const TargetData *TD,
//===----------------------------------------------------------------------===//
-// clloc Call Utility Functions.
+// calloc Call Utility Functions.
//
static bool isCallocCall(const CallInst *CI) {
@@ -197,7 +197,7 @@ static bool isCallocCall(const CallInst *CI) {
// Check malloc prototype.
// FIXME: workaround for PR5130, this will be obsolete when a nobuiltin
- // attribute will exist.
+ // attribute exists.
FunctionType *FTy = Callee->getFunctionType();
return FTy->getReturnType() == Type::getInt8PtrTy(FTy->getContext()) &&
FTy->getNumParams() == 2 &&
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index 4196ca6cf79..5fdb57bc7aa 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -172,7 +172,7 @@ Instruction *InstCombiner::SimplifyMemSet(MemSetInst *MI) {
Instruction *InstCombiner::visitCallInst(CallInst &CI) {
if (isFreeCall(&CI))
return visitFree(CI);
- if (isMalloc(&CI))
+ if (extractMallocCall(&CI) || extractCallocCall(&CI))
return visitMalloc(CI);
// If the caller function is nounwind, mark the call as nounwind, even if the
OpenPOWER on IntegriCloud