No need to verify that malloc's return type is i8*.
[oota-llvm.git] / lib / VMCore / Verifier.cpp
index f1f6e2e199bf1ccbce2d3e75ad569741900d9ba1..140e6bd8b15a78c1ffeefa091b28afc4247bc77a 100644 (file)
@@ -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) {