aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVictor Hernandez <vhernandez@apple.com>2009-09-22 18:50:03 +0000
committerVictor Hernandez <vhernandez@apple.com>2009-09-22 18:50:03 +0000
commitd80fa7f67d06ef47913578a8212be349722a9df5 (patch)
tree032615b612413264ee08b56f5777f092619ad760 /lib
parentcc74792c99e085a14bdd6db9edea362b465406da (diff)
downloadexternal_llvm-d80fa7f67d06ef47913578a8212be349722a9df5.zip
external_llvm-d80fa7f67d06ef47913578a8212be349722a9df5.tar.gz
external_llvm-d80fa7f67d06ef47913578a8212be349722a9df5.tar.bz2
No need to verify that malloc's return type is i8*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82561 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/MallocHelper.cpp2
-rw-r--r--lib/VMCore/Verifier.cpp10
2 files changed, 1 insertions, 11 deletions
diff --git a/lib/Analysis/MallocHelper.cpp b/lib/Analysis/MallocHelper.cpp
index 9c1671d..ab6239e 100644
--- a/lib/Analysis/MallocHelper.cpp
+++ b/lib/Analysis/MallocHelper.cpp
@@ -155,7 +155,7 @@ const PointerType* llvm::getMallocType(const CallInst* CI) {
if (BCI && CI->hasOneUse())
return cast<PointerType>(BCI->getDestTy());
- // Malloc call was not bitcast, so the type is the malloc's return type, i8*.
+ // Malloc call was not bitcast, so type is the malloc function's return type.
if (!BCI)
return cast<PointerType>(CI->getType());
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index f1f6e2e..140e6bd 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -1143,16 +1143,6 @@ void Verifier::visitCallInst(CallInst &CI) {
if (Function *F = CI.getCalledFunction())
if (Intrinsic::ID ID = (Intrinsic::ID)F->getIntrinsicID())
visitIntrinsicFunctionCall(ID, CI);
-
- // Code here matches isMalloc from MallocHelper, which is not in VMCore.
- const Module* M = CI.getParent()->getParent()->getParent();
- Constant *MallocFunc = M->getFunction("malloc");
-
- if (CI.getOperand(0) == MallocFunc) {
- const PointerType *PTy =
- PointerType::getUnqual(Type::getInt8Ty(CI.getParent()->getContext()));
- Assert1(CI.getType() == PTy, "Malloc call must return i8*", &CI);
- }
}
void Verifier::visitInvokeInst(InvokeInst &II) {