LLVMBasicBlock.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sat, 08 Aug 2015 04:43:00 +0100
changeset 22 789a35bd30ac
parent 14 c7dea3fcc5a7
child 28 97013ae2abae
permissions -rw-r--r--
Added example for compiling conditional. Added convenience API to simply code generation.

"
    Copyright (C) 2015-now Jan Vrany

    This code is not an open-source (yet). You may use this code
    for your own experiments and projects, given that:

    * all modification to the code will be sent to the
      original author for inclusion in future releases
    * this is not used in any commercial software

    This license is provisional and may (will) change in
    a future.
"
"{ Package: 'jv:llvm_s' }"

"{ NameSpace: Smalltalk }"

LLVMObject subclass:#LLVMBasicBlock
	instanceVariableNames:'function'
	classVariableNames:''
	poolDictionaries:''
	category:'LLVM-S-Core'
!

!LLVMBasicBlock class methodsFor:'documentation'!

copyright
"
    Copyright (C) 2015-now Jan Vrany

    This code is not an open-source (yet). You may use this code
    for your own experiments and projects, given that:

    * all modification to the code will be sent to the
      original author for inclusion in future releases
    * this is not used in any commercial software

    This license is provisional and may (will) change in
    a future.
"
! !

!LLVMBasicBlock methodsFor:'accessing'!

builder
    "Return a builder positioned at the end of the receiver"

    | builder |

    builder := LLVMBuilder new.
    builder positionAtEnd: self.
    ^ builder

    "Created: / 08-08-2015 / 03:25:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

function
    ^ function

    "Created: / 08-08-2015 / 03:22:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!LLVMBasicBlock methodsFor:'converting'!

asLLVMValue
    "Return representation of the receiver as LLVMValue"

    ^ LLVM BasicBlockAsValue: self

    "Created: / 08-08-2015 / 02:11:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!LLVMBasicBlock methodsFor:'initialization'!

function:anLLVMFunction
    function := anLLVMFunction.

    "Created: / 08-08-2015 / 03:22:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !