[llvm-commits] [llvm] r82561 - in /llvm/trunk/lib: Analysis/MallocHelper.cpp VMCore/Verifier.cpp
Victor Hernandez
vhernandez at apple.com
Tue Sep 22 11:50:04 PDT 2009
Author: hernande
Date: Tue Sep 22 13:50:03 2009
New Revision: 82561
URL: http://llvm.org/viewvc/llvm-project?rev=82561&view=rev
Log:
No need to verify that malloc's return type is i8*.
Modified:
llvm/trunk/lib/Analysis/MallocHelper.cpp
llvm/trunk/lib/VMCore/Verifier.cpp
Modified: llvm/trunk/lib/Analysis/MallocHelper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MallocHelper.cpp?rev=82561&r1=82560&r2=82561&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/MallocHelper.cpp (original)
+++ llvm/trunk/lib/Analysis/MallocHelper.cpp Tue Sep 22 13:50:03 2009
@@ -155,7 +155,7 @@
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());
Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=82561&r1=82560&r2=82561&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Tue Sep 22 13:50:03 2009
@@ -1143,16 +1143,6 @@
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) {
More information about the llvm-commits
mailing list