LLVMCEXT.st
changeset 24 7e7ddd55174c
child 29 6ea02617c9ab
equal deleted inserted replaced
23:0744cd9c0acc 24:7e7ddd55174c
       
     1 "
       
     2     Copyright (C) 2015-now Jan Vrany
       
     3 
       
     4     This code is not an open-source (yet). You may use this code
       
     5     for your own experiments and projects, given that:
       
     6 
       
     7     * all modification to the code will be sent to the
       
     8       original author for inclusion in future releases
       
     9     * this is not used in any commercial software
       
    10 
       
    11     This license is provisional and may (will) change in
       
    12     a future.
       
    13 "
       
    14 "{ Package: 'jv:llvm_s' }"
       
    15 
       
    16 "{ NameSpace: Smalltalk }"
       
    17 
       
    18 Object subclass:#LLVMCEXT
       
    19 	instanceVariableNames:''
       
    20 	classVariableNames:''
       
    21 	poolDictionaries:''
       
    22 	category:'LLVM-S-Internal'
       
    23 !
       
    24 
       
    25 !LLVMCEXT class methodsFor:'documentation'!
       
    26 
       
    27 copyright
       
    28 "
       
    29     Copyright (C) 2015-now Jan Vrany
       
    30 
       
    31     This code is not an open-source (yet). You may use this code
       
    32     for your own experiments and projects, given that:
       
    33 
       
    34     * all modification to the code will be sent to the
       
    35       original author for inclusion in future releases
       
    36     * this is not used in any commercial software
       
    37 
       
    38     This license is provisional and may (will) change in
       
    39     a future.
       
    40 "
       
    41 !
       
    42 
       
    43 documentation
       
    44 "
       
    45     This class contains call out to LLVM C API extensions library
       
    46     (which is part of llvm-s bindings).
       
    47 
       
    48     This library exposes important LLVM C++ API tp C users, including:
       
    49     * access to intrinsics
       
    50 
       
    51     [author:]
       
    52         Jan Vrany <jan.vrany@fit.cvut.cz>
       
    53 
       
    54     [instance variables:]
       
    55 
       
    56     [class variables:]
       
    57 
       
    58     [see also:]
       
    59 
       
    60 "
       
    61 ! !
       
    62 
       
    63 !LLVMCEXT class methodsFor:'accessing'!
       
    64 
       
    65 libraryName
       
    66     | pkgDir |
       
    67     pkgDir := Smalltalk getPackageDirectoryForPackage: #jv:llvm_s.
       
    68     pkgDir isNil ifTrue:[ 
       
    69         self error: 'Cannot find package directory for jv:llvm_c. Check #packagePath'.
       
    70     ].
       
    71     OperatingSystem isUNIXlike ifTrue:[ 
       
    72         ^ (pkgDir / 'llvm_c_ext' / 'lib' / 'libLLVM-C-EXT.so') pathName
       
    73     ].
       
    74     self error:'Unsupported operating system'
       
    75 
       
    76     "Created: / 10-08-2015 / 16:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    77 ! !
       
    78 
       
    79 !LLVMCEXT class methodsFor:'primitives'!
       
    80 
       
    81 GetIntrinsicByName: mod _: name _: count _: types
       
    82     "@param mod: LLVMValueRef
       
    83      @param name: const char *
       
    84      @param count: int32
       
    85      @param types: LLVMTypeRef*
       
    86      @return: LLVMValue
       
    87     "
       
    88 
       
    89     <cdecl: LLVMFunction "LLVMGetIntrinsicByName" ( LLVMModule charPointer int32 pointer ) >
       
    90     self primitiveFailed
       
    91 
       
    92     "Created: / 10-08-2015 / 17:02:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    93 ! !
       
    94 
       
    95 !LLVMCEXT class methodsFor:'documentation'!
       
    96 
       
    97 version
       
    98     ^ 'Path: jv/llvm_s/LLVMCEXT.st, Version: 1.0, User: jv, Time: 2015-08-10T19:13:47.892+01'
       
    99 !
       
   100 
       
   101 version_HG
       
   102     ^ 'Path: jv/llvm_s/LLVMCEXT.st, Version: 1.0, User: jv, Time: 2015-08-10T19:13:47.892+01'
       
   103 ! !
       
   104