LLVMIRBuilder.st
changeset 58 6b9f8fec013a
parent 57 4ca7c3a327a2
child 61 c2e287d54de5
--- a/LLVMIRBuilder.st	Fri Feb 12 11:50:22 2016 +0000
+++ b/LLVMIRBuilder.st	Wed Apr 20 22:20:00 2016 +0100
@@ -83,6 +83,22 @@
     "Created: / 10-08-2015 / 09:03:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+continue: anLLVMBasicBlock
+    "Like block, but if current block has no terminator,
+     add an unconditional jump to `anLLVMBasicBlock1` so
+     exection continues there"
+
+    | last |
+
+    last := self block lastInstruction.
+    (last isNil or:[ last isTerminatorInst not ]) ifTrue:[ 
+        self br: anLLVMBasicBlock.
+    ].
+    ^ self positionAtEnd: anLLVMBasicBlock
+
+    "Created: / 20-04-2016 / 22:00:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 line: line column: column scope: scope
     "Sets the current location in original source (i.e., on source being
      translated to LLVM IR). This information is used generate debug information."