jv_llvm_s.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 06 Jul 2016 09:53:56 +0100
changeset 70 ced2a5c16e70
parent 65 9244f78bcf02
child 78 7a4c769a9fea
permissions -rw-r--r--
Added builder support for llvm.memset , llvm.memmove and llvm.memcpy intrinsics For those, use specialized IR builder routines rather than manually calling the intrinsic. The problem which the latter is that those instrinsics are overloaded and - for reason not yet known - retrieving them cause crash. So better strick to LLVM way of doing so - through IRBuilder.

"
    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 }"

LibraryDefinition subclass:#jv_llvm_s
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'* Projects & Packages *'
!

!jv_llvm_s 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.
"
!

documentation
"
    LLVM-S provides malltalk(X) bindings to LLVM toolchain.
    It allows one to compile functions dynamically using LLVM IR.

    [author:]
        Jan Vrany <jan.vrany@fit.cvut.cz>

    [see also:]
        https://bitbucket.org/janvrany/jv-llvm-s
        http://llvm.org/
        class LLVMExamples

"
! !

!jv_llvm_s class methodsFor:'description'!

excludedFromPreRequisites
    "list packages which are to be explicitely excluded from the automatic constructed
     prerequisites list. If empty, everything that is found along the inheritance of any of
     my classes is considered to be a prerequisite package."

    ^ #(
    )
!

mandatoryPreRequisites
    "list packages which are mandatory as a prerequisite.
     This are packages containing superclasses of my classes and classes which
     are extended by myself.
     They are mandatory, because we need these packages as a prerequisite for loading and compiling.
     This method is generated automatically,
     by searching along the inheritance chain of all of my classes."

    ^ #(
        #'stx:libbasic'    "ArrayedCollection - superclass of LLVMObjectArray"
    )
!

referencedPreRequisites
    "list packages which are a prerequisite, because they contain
     classes which are referenced by my classes.
     We do not need these packages as a prerequisite for compiling or loading,
     however, a class from it may be referenced during execution and having it
     unloaded then may lead to a runtime doesNotUnderstand error, unless the caller
     includes explicit checks for the package being present.
     This method is generated automatically,
     by searching all classes (and their packages) which are referenced by my classes."

    ^ #(
    )
!

subProjects
    "list packages which are known as subprojects.
     The generated makefile will enter those and make there as well.
     However: they are not forced to be loaded when a package is loaded;
     for those, redefine requiredPrerequisites."

    ^ #(
    )
! !

!jv_llvm_s class methodsFor:'description - compilation'!

additionalRules_make_dot_proto
    "allows for additional rules to be added to the make.proto file."

    ^ '
.phony: build_llvm_c_ext

build_llvm_c_ext:
	$(MAKE) -C llvm_c_ext
'

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

additionalTargets_make_dot_proto
    "allows for additional targets to be added to the make.proto file."

    ^ 'build_llvm_c_ext'

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

!jv_llvm_s class methodsFor:'description - contents'!

classNamesAndAttributes
    "lists the classes which are to be included in the project.
     Each entry in the list may be: a single class-name (symbol),
     or an array-literal consisting of class name and attributes.
     Attributes are: #autoload or #<os> where os is one of win32, unix,..."

    ^ #(
        "<className> or (<className> attributes...) in load order"
        LLVM
        LLVMAtomicOrdering
        LLVMAtomicRMWBinOp
        LLVMAttribute
        LLVMByteOrdering
        LLVMCEXT
        LLVMCallConv
        LLVMConfig
        LLVMConstant
        LLVMDLLStorageClass
        LLVMDWARFEncoding
        LLVMDWARFLamguage
        LLVMDiagnosticSeverity
        LLVMError
        LLVMIntPredicate
        LLVMLandingPadClauseTy
        LLVMLinkage
        LLVMMCJITCompilerOptions
        LLVMMetadataKind
        LLVMModuleFlagBehavior
        LLVMModuleVerificationError
        LLVMObjectArray
        LLVMOpcode
        LLVMRealPredicate
        LLVMThreadLocalMode
        LLVMTypeKind
        LLVMVerifierFailureAction
        LLVMVisibility
        #'jv_llvm_s'
        LLVMObject
        LLVMTypeError
        LLVMBasicBlock
        LLVMContext
        LLVMDiagnosticInfo
        LLVMDisposableObject
        LLVMMetadata
        LLVMPassRegistry
        LLVMTargetLibraryInfo
        LLVMType
        LLVMTypeMismatchError
        LLVMUse
        LLVMValue
        LLVMDIBuilder
        LLVMExecutionEngine
        LLVMFunction
        LLVMGenericValue
        LLVMIRBuilder
        LLVMMCJITMemoryManager
        LLVMModule
        LLVMModuleProvider
        LLVMPassManager
        LLVMTargetData
        LLVMTypeFunction
        LLVMTypeLabel
        LLVMTypeMetadata
        LLVMTypeScalar
        LLVMTypeSequential
        LLVMTypeStruct
        LLVMTypeVoid
        LLVMStXMethod
        LLVMTypeArray
        LLVMTypeFloatingPoint
        LLVMTypeHalt
        LLVMTypeInteger
        LLVMTypePointer
        LLVMTypeVector
        #'LLVMTypeX86_MMX'
        LLVMTypeDouble
        LLVMTypeFP128
        LLVMTypeFloat
        #'LLVMTypePPC_FP128'
        #'LLVMTypeX86_FP80'
        (LLVMExamples autoload)
    )
!

extensionMethodNames
    "lists the extension methods which are to be included in the project.
     Entries are 2-element array literals, consisting of class-name and selector.
     A correponding method with real names must be present in my concrete subclasses
     if it has extensions."

    ^ #(
        SequenceableCollection asLLVMObjectArray
        Object asLLVMValue
        Object asLLVMValueOfType:
        Object isLLVMType
        Object isLLVMValue
        Object isLLVMFunction
        Object asLLVMMetadata
        Object asLLVMBasicBlock
    )
! !

!jv_llvm_s class methodsFor:'description - project information'!

companyName
    "Returns a company string which will appear in <lib>.rc.
     Under win32, this is placed into the dlls file-info"

    ^ 'Jan Vrany'

    "Modified: / 01-08-2015 / 06:43:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

description
    "Returns a description string which will appear in nt.def / bc.def"

    ^ 'Smalltalk(X) bindings to LLVM'

    "Modified: / 01-08-2015 / 06:44:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

legalCopyright
    "Returns a copyright string which will appear in <lib>.rc.
     Under win32, this is placed into the dlls file-info"

    ^ 'Copyright 2015-now Jan Vrany'

    "Modified: / 01-08-2015 / 06:44:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

productName
    "Returns a product name which will appear in <lib>.rc.
     Under win32, this is placed into the dlls file-info.
     This method is usually redefined in a concrete application definition"

    ^ 'LLVM-S'

    "Modified: / 01-08-2015 / 06:44:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!jv_llvm_s class methodsFor:'documentation'!

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