diff gen/functions.cpp @ 328:7086a84ab3d6 trunk

[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.
author lindquist
date Fri, 11 Jul 2008 00:17:00 +0200
parents 665b81613475
children 8c1dc3e705da
line wrap: on
line diff
--- a/gen/functions.cpp	Thu Jul 10 22:00:27 2008 +0200
+++ b/gen/functions.cpp	Fri Jul 11 00:17:00 2008 +0200
@@ -732,22 +732,9 @@
     // 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