extensions.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 17 Sep 2015 17:17:56 +0100
changeset 42 23ae490859cd
parent 33 feabf14b6c1d
child 46 ed599c4d3e94
permissions -rw-r--r--
Fixed LLVMExamples>>example7_factorial_with_debug_info Pass DIFile instead of DICompileUnit to #createTypeFunctionIn:parameterTypes: Fixed #createParameterVariable: - parameters are numbered starting with 1.

"{ Package: 'jv:llvm_s' }"!

!Object methodsFor:'converting'!

asLLVMMetadata
    "Return representation of the receiver as LLVMMetadata."

    "Raise an error - arbitrary object cannot be represented
     as LLVM metadata"
    self error: 'cannot be converted to an LLVM metadata'

    "Created: / 15-08-2015 / 06:43:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!Object methodsFor:'converting'!

asLLVMValue
    "Return representation of the receiver as LLVMValue."

    "Raise an error - arbitrary object cannot be represented
     as LLVM value"
    self error: 'cannot be converted to an LLVM value'

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

!Object methodsFor:'converting'!

asLLVMValueOfType: anLLVMType
    "Return representation of the receiver as LLVMValue with given LLVMType. 
     If the object cannot be converted to the balue of requested type, 
     raise an error."

    self error: 'cannot be converted to an LLVM value'

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

!Object methodsFor:'testing'!

isLLVMFunction
    "Return true, if receiver represents an LLVM value representing a function"

    ^ false

    "Created: / 10-08-2015 / 19:01:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!Object methodsFor:'testing'!

isLLVMType
    "Return true, if receiver represents an LLVM type"

    ^ false

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

!Object methodsFor:'testing'!

isLLVMValue
    "Return true, if receiver represents an LLVM value"

    ^ false

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

!SequenceableCollection methodsFor:'converting'!

asLLVMObjectArray
    | array size | 

    size := self size.
    size == 0 ifTrue:[ 
        ^ nil
    ].
    array := LLVMObjectArray new: size.
    array replaceFrom: 1 count: size with: self.
    ^array

    "Created: / 08-07-2015 / 22:58:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 03-08-2015 / 17:04:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!stx_goodies_sunit class methodsFor:'documentation'!

version_HG
    ^ '$Changeset: <not expanded> $'
! !

!stx_libbasic class methodsFor:'documentation'!

version_HG
    ^ '$Changeset: <not expanded> $'
! !

!jv_llvm_s class methodsFor:'documentation'!

extensionsVersion_HG

    ^ '$Changeset: <not expanded> $'
! !