[svn r349] Fixed problems with static arrays of void as well as a static arrays with zero length.

Fixed issues with DMD generated assert statements when using class invariants, generally due to incomplete ASTs.
Removed some dead code.
Added a few comments.
This commit is contained in:
Tomas Lindquist Olsen
2008-07-11 00:17:00 +02:00
parent bace4dd0e7
commit 521de1a47e
8 changed files with 56 additions and 89 deletions
+2 -15
View File
@@ -732,22 +732,9 @@ void DtoDefineFunc(FuncDeclaration* fd)
// if the last block is empty now, it must be unreachable or it's a bug somewhere else
// would be nice to figure out how to assert that this is correct
llvm::BasicBlock* lastbb = &func->getBasicBlockList().back();
if (lastbb->empty()) {
if (lastbb->empty())
{
new llvm::UnreachableInst(lastbb);
// if (llvm::pred_begin(lastbb) != llvm::pred_end(lastbb))
// {
// Logger::println("Erasing lastbb");
// lastbb->eraseFromParent();
// }
// else {
// new llvm::UnreachableInst(lastbb);
// // if (func->getReturnType() == LLType::VoidTy) {
// // llvm::ReturnInst::Create(lastbb);
// // }
// // else {
// // llvm::ReturnInst::Create(llvm::UndefValue::get(func->getReturnType()), lastbb);
// // }
// }
}
// if the last block is not terminated we return a null value or void