aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
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
commit3d775c3f39bf8ac2eb945e32865a5ace7b12a29e (patch)
tree8f65842658c61649519618ec5800a6c117365339 /lib/Transforms
parente85f2332dbdd7ed50635b9095d021b086d26f488 (diff)
downloadexternal_llvm-3d775c3f39bf8ac2eb945e32865a5ace7b12a29e.zip
external_llvm-3d775c3f39bf8ac2eb945e32865a5ace7b12a29e.tar.gz
external_llvm-3d775c3f39bf8ac2eb945e32865a5ace7b12a29e.tar.bz2
Avoid assertion failure when taking size of unsized array. Todo item herE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1286 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/LevelRaise.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Transforms/LevelRaise.cpp b/lib/Transforms/LevelRaise.cpp
index 310c797..03d7acf 100644
--- a/lib/Transforms/LevelRaise.cpp
+++ b/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;