[llvm-commits] [hlvm] r38381 - /hlvm/trunk/hlvm/CodeGen/LLVMEmitter.cpp

Reid Spencer reid at x10sys.com
Sat Jul 7 17:02:51 PDT 2007


Author: reid
Date: Sat Jul  7 19:02:51 2007
New Revision: 38381

URL: http://llvm.org/viewvc/llvm-project?rev=38381&view=rev
Log:
Fix bugs having to do with block termination resulting from the code refactor.

Modified:
    hlvm/trunk/hlvm/CodeGen/LLVMEmitter.cpp

Modified: hlvm/trunk/hlvm/CodeGen/LLVMEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/CodeGen/LLVMEmitter.cpp?rev=38381&r1=38380&r2=38381&view=diff

==============================================================================
--- hlvm/trunk/hlvm/CodeGen/LLVMEmitter.cpp (original)
+++ hlvm/trunk/hlvm/CodeGen/LLVMEmitter.cpp Sat Jul  7 19:02:51 2007
@@ -97,12 +97,16 @@
         "entry_point", TheEntryBlock);
 
   // Create a new block for the return node, but don't insert it yet.
-  TheExitBlock = new BasicBlock("exit");
+  // TheExitBlock = new BasicBlock("exit");
 }
 
 void
 LLVMEmitter::FinishFunction()
 {
+  // The entry block was created to hold the automatic variables. We now
+  // need to terminate the block by branching it to the first active block
+  // in the function.
+  new llvm::BranchInst(TheFunction->front().getNext(),&TheFunction->front());
   hlvmAssert(blocks.empty());
   hlvmAssert(breaks.empty());
   hlvmAssert(continues.empty());





More information about the llvm-commits mailing list