summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-12-14 16:32:20 +0000
committerChris Lattner <sabre@nondot.org>2001-12-14 16:32:20 +0000
commit11439b236042f884293b56c1c90b3acfd9268974 (patch)
treef7a2abc6522edf82ecd4315d2ccc845e536227c7 /llvm/lib/Transforms
parent7dc20864b6eed71c15120c8b9531a26b02a5ab1c (diff)
downloadbcm5719-llvm-11439b236042f884293b56c1c90b3acfd9268974.tar.gz
bcm5719-llvm-11439b236042f884293b56c1c90b3acfd9268974.zip
The proper prototype for malloc returns a pointer, not an unsized array
llvm-svn: 1463
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/DeadTypeElimination.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp b/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp
index e194bf4b5fa..ec4c3fd66e6 100644
--- a/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp
+++ b/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp
@@ -24,7 +24,6 @@
#include "llvm/iOther.h"
#include <algorithm>
-static const Type *PtrArrSByte = 0; // '[sbyte]*' type
static const Type *PtrSByte = 0; // 'sbyte*' type
// ConvertCallTo - Convert a call to a varargs function with no arg types
@@ -226,10 +225,8 @@ bool CleanupGCCOutput::doPassInitialization(Module *M) {
FUT.doPassInitialization(M);
- if (PtrArrSByte == 0) {
- PtrArrSByte = PointerType::get(ArrayType::get(Type::SByteTy));
- PtrSByte = PointerType::get(Type::SByteTy);
- }
+ if (PtrSByte == 0)
+ PtrSByte = PointerType::get(Type::SByteTy);
if (M->hasSymbolTable()) {
SymbolTable *ST = M->getSymbolTable();
@@ -304,7 +301,7 @@ bool CleanupGCCOutput::doOneCleanupPass(Method *M) {
if (CallInst *CI = dyn_cast<CallInst>(I)) {
if (CI->getCalledValue() == Malloc) { // Replace call to malloc?
- MallocInst *MallocI = new MallocInst(PtrArrSByte, CI->getOperand(1),
+ MallocInst *MallocI = new MallocInst(PtrSByte, CI->getOperand(1),
CI->getName());
CI->setName("");
BI = BIL.insert(BI, MallocI)+1;
OpenPOWER on IntegriCloud