summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/LevelRaise.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-11-13 04:59:41 +0000
committerChris Lattner <sabre@nondot.org>2001-11-13 04:59:41 +0000
commit4f8e9468cbc0b088ce7398c848d5f37432e7edd3 (patch)
tree44475ed868bb1e5a537f5c9b47a20372636e9f52 /llvm/lib/Transforms/LevelRaise.cpp
parentdafc8b909e3729b0ca13e80fa49e66a2f0f13b38 (diff)
downloadbcm5719-llvm-4f8e9468cbc0b088ce7398c848d5f37432e7edd3.tar.gz
bcm5719-llvm-4f8e9468cbc0b088ce7398c848d5f37432e7edd3.zip
Avoid assertion failure when taking size of unsized array. Todo item herE
llvm-svn: 1286
Diffstat (limited to 'llvm/lib/Transforms/LevelRaise.cpp')
-rw-r--r--llvm/lib/Transforms/LevelRaise.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/LevelRaise.cpp b/llvm/lib/Transforms/LevelRaise.cpp
index 310c797b8f3..03d7acf5b6f 100644
--- a/llvm/lib/Transforms/LevelRaise.cpp
+++ b/llvm/lib/Transforms/LevelRaise.cpp
@@ -214,6 +214,11 @@ static bool PeepholeMallocInst(BasicBlock *BB, BasicBlock::iterator &BI) {
}
const Type *DestTy = cast<PointerType>(CI->getType())->getValueType();
+ if (isa<ArrayType>(DestTy)) {
+ cerr << "Avoided malloc conversion because of type: " << DestTy
+ << " TODO.\n";
+ return false;
+ }
if (TD.getTypeSize(DestTy) == Size && DestTy != ResultTy) {
// Does the size of the allocated type match the number of bytes
// allocated?
@@ -444,6 +449,7 @@ static bool PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) {
}
#endif
+#if 1
} else if (MallocInst *MI = dyn_cast<MallocInst>(I)) {
if (PeepholeMallocInst(BB, BI)) return true;
@@ -623,6 +629,7 @@ static bool PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) {
PRINT_PEEPHOLE2("add-to-gep:out", GEP, I);
return true;
}
+#endif
}
return false;
OpenPOWER on IntegriCloud