Minor code cleanup.
authorVictor Hernandez <vhernandez@apple.com>
Fri, 23 Oct 2009 00:59:10 +0000 (00:59 +0000)
committerVictor Hernandez <vhernandez@apple.com>
Fri, 23 Oct 2009 00:59:10 +0000 (00:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84919 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AsmParser/LLParser.cpp

index 8724470c9bbe4aa994019afa1d066b3663c5235e..271567bd1e9b57346345d182d12f2e767ed3cd5e 100644 (file)
@@ -3485,12 +3485,11 @@ bool LLParser::ParseAlloc(Instruction *&Inst, PerFunctionState &PFS,
   // Autoupgrade old malloc instruction to malloc call.
   // FIXME: Remove in LLVM 3.0.
   const Type *IntPtrTy = Type::getInt32Ty(Context);
-  const Type *Int8PtrTy = Type::getInt8PtrTy(Context);
   if (!MallocF)
     // Prototype malloc as "void *(int32)".
     // This function is renamed as "malloc" in ValidateEndOfModule().
-    MallocF = cast<Function>(M->getOrInsertFunction(NULL, Int8PtrTy, 
-                                                    IntPtrTy, NULL));
+    MallocF = cast<Function>(
+       M->getOrInsertFunction("", Type::getInt8PtrTy(Context), IntPtrTy, NULL));
   Inst = CallInst::CreateMalloc(BB, IntPtrTy, Ty, Size, MallocF);
   return false;
 }