Jan Vrany <jan.vrany@fit.cvut.cz> [Thu, 15 Sep 2016 22:14:32 +0100] rev 79
llvm_c_ext: Updated to use `llvm::DINode::DIFlags` rather than just `unsigned`. Added new constantpool `LLVMDIFLags`
Jan Vrany <jan.vrany@fit.cvut.cz> [Tue, 30 Aug 2016 16:57:29 +0100] rev 78
llvm_c_ext: Improved `LLVMSetMetadata2()` to support also function values
...in addition to instruction values. This is handy to attach data to functions,
such as debugging information. Added Smalltalk API for setting metadata nodes
on instructions and functions.
Jan Vrany <jan.vrany@fit.cvut.cz> [Tue, 30 Aug 2016 12:29:23 +0100] rev 77
llvm_c_ext: Added `LLVMPrintMetadataToString()`
...and corresponding Smalltalk API. Useful for debugging.
Jan Vrany <jan.vrany@fit.cvut.cz> [Fri, 26 Aug 2016 21:50:03 +0100] rev 76
llvm_c_ext: Added LLVMSetProcessAllSections()
...as an C interface for llvm::ExecutionEngine::setProcessAllSections(). This
may become handy when one wants to control allocation of sections not strictly
required for execution.
Jan Vrany <jan.vrany@fit.cvut.cz> [Wed, 24 Aug 2016 15:00:24 +0100] rev 75
llvm_c_ext: LLVMGetMetadataKind refactored to use sequence of `if (isa<DIFile>(...)) return ...`
rather than depending on value if `getMedatadataID()`. Values of individual constants
in `llvm::Metadata::MetadataKind` are not stable and change over time (so does the
`getMetadataID()` return value). This leads to funny problems.
Therefore, define our own enum - `LLVMMetadataKind` with stable values and use sequence
of ifs to translate between LLVM metadata class and `LLVMMetadataKind` enum value.
Jan Vrany <jan.vrany@fit.cvut.cz> [Tue, 23 Aug 2016 23:37:31 +0100] rev 74
Show metadata kind in LLVMMetadata print string
...i.e., DILocation@12345678 rather then generic LLVMMetadata@12345678
Jan Vrany <jan.vrany@fit.cvut.cz> [Thu, 11 Aug 2016 09:12:17 +0100] rev 73
Oops, fixed examples after a rename #store:_: to #store:at:
Jan Vrany <jan.vrany@fit.cvut.cz> [Fri, 05 Aug 2016 17:12:05 +0100] rev 72
Added builder support for zext, sext and trunc IR instructions
Jan Vrany <jan.vrany@fit.cvut.cz> [Wed, 06 Jul 2016 22:40:59 +0100] rev 71
Implemented LLVMType>>sizeInBits/sizeInBytes for all data types
...i.e., also for structures, vectors and arrays.
Jan Vrany <jan.vrany@fit.cvut.cz> [Wed, 06 Jul 2016 09:53:56 +0100] rev 70
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.
Jan Vrany <jan.vrany@fit.cvut.cz> [Sun, 26 Jun 2016 06:51:27 +0100] rev 69
Added #sint8: and #unit8: constructors to `LLVMConstant` class
Jan Vrany <jan.vrany@fit.cvut.cz> [Mon, 20 Jun 2016 09:20:27 +0100] rev 68
Added LLVMValue>>initilizer: to allow constanv value fixups.
This is useful in cases when the value of the global variable is
not known at the time it's created - but it must be known before
a machine code is emmited, indeed.
Jan Vrany <jan.vrany@fit.cvut.cz> [Mon, 20 Jun 2016 09:17:32 +0100] rev 67
New utility methods to create constant pointers
Jan Vrany <jan.vrany@fit.cvut.cz> [Sat, 18 Jun 2016 16:54:17 +0100] rev 66
Fixed LLVMIRBuilder>>if:then:else: for nested ifs and complex branches.
Jan Vrany <jan.vrany@fit.cvut.cz> [Sat, 18 Jun 2016 16:00:36 +0100] rev 65
Added LLVMModule>>verify and LLVMFunction>>verify
Jan Vrany <jan.vrany@fit.cvut.cz> [Fri, 17 Jun 2016 23:43:23 +0100] rev 64
Renamed #store:_: to #store:at: which reads better
Jan Vrany <jan.vrany@fit.cvut.cz> [Sun, 24 Apr 2016 08:27:47 +0100] rev 63
Tests: Added LLBMIRBuilderTests
Jan Vrany <jan.vrany@fit.cvut.cz> [Fri, 22 Apr 2016 14:45:34 +0100] rev 62
Added 'block form' of #if:then:else: for easier use
A 'block form' allows one to use it as in following example:
asm if: cond then: [
asm ...
] else: [
asm ...
].
adm ...
This means that user of LLVMIRBuilder need not fiddle about basic blocks
and their proper linking for generate a simple condition.
Jan Vrany <jan.vrany@fit.cvut.cz> [Thu, 21 Apr 2016 22:17:02 +0100] rev 61
Added support for PHI nodes.
Even though manual use of these is discouraged, this may be very handy
when one needs to generate `cond ? tval : fval` kind of expression.
In some cases one may not use `select` instructions is nay compile
to CMOV on Intel which has its issues and may lead to SEGV.
Jan Vrany <jan.vrany@fit.cvut.cz> [Thu, 21 Apr 2016 09:50:02 +0100] rev 60
Fixed finalization of MCJIT memory manager / execution engine
If options specifies a custom MM, must unregister it from
finalization as the disposal of LLVMExecutionEngine disposes
the MM itself. If we won't unregister it, it will be disposed
twice.
Jan Vrany <jan.vrany@fit.cvut.cz> [Thu, 21 Apr 2016 08:42:39 +0100] rev 59
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz> [Wed, 20 Apr 2016 22:20:00 +0100] rev 58
Added convenience LLVMIRBuilder>>continue:
Jan Vrany <jan.vrany@fit.cvut.cz> [Fri, 12 Feb 2016 11:50:22 +0000] rev 57
LLVMDIBuilder: added API for more instructions
* inttoptr
* ptrtoint
* select
Jan Vrany <jan.vrany@fit.cvut.cz> [Mon, 08 Feb 2016 19:02:53 +0000] rev 56
Added support for creatiing an LLVMExecutionEngine with custom memory manager.
Jan Vrany <jan.vrany@fit.cvut.cz> [Sun, 07 Feb 2016 09:03:23 +0000] rev 55
LLVM C API Extensions: Updated Smalltalk API to reflect LLVM 3.9 API.
This is a follow-up change tp a288aced3dd1.
Jan Vrany <jan.vrany@fit.cvut.cz> [Wed, 27 Jan 2016 14:20:58 +0000] rev 54
LLVM C API Extensions: Fixed DIBuilerCreateFunction() and DIBuilderCreateSubroutineType() for LLVM 3.9
In LLVM 3.9 some parameters to these functions were dropped. The DIBuilder interface
has been changed to reflect these changes (i.e., C functions no longer require dropped
argument). The LLVM C Extensions library can still be compiled against LLVM 3.8
(via #ifdef), but the API will be different. Also, the Smalltallks bindings will
make use of LLVM 3.9 interface. That said, LLVM C API Extensions library may still
be used by *other* projects on top of LLVM 3.8, though Smalltalk bindings require
LLVM 3.9 from now on.
Jan Vrany <jan.vrany@fit.cvut.cz> [Wed, 27 Jan 2016 11:43:56 +0000] rev 53
LLVM 3.9: Vector types are supported only for pointers, integer and floating points.
...for all other tyoes throw an MethodNotAppropriateError error when one
try to create a vector (by means of #vector: message)
Jan Vrany <jan.vrany@fit.cvut.cz> [Tue, 26 Jan 2016 23:45:52 +0000] rev 52
Moved LLVMModuleTests to package jv:llvm_s/tests
Jan Vrany <jan.vrany@fit.cvut.cz> [Tue, 26 Jan 2016 22:17:13 +0000] rev 51
Fixed LLVMConfig to work with hand-compiled LLVM 3.9.
The shared library naming convention under Linux changed (again, sigh)
Jan Vrany <jan.vrany@fit.cvut.cz> [Mon, 12 Oct 2015 20:52:13 +0100] rev 50
Support for creating recursive structures.
And few inspector enhancements to inspect types...
Jan Vrany <jan.vrany@fit.cvut.cz> [Wed, 07 Oct 2015 06:10:55 +0100] rev 49
Oops, re-added LLVMType>>struct:packed:
Jan Vrany <jan.vrany@fit.cvut.cz> [Mon, 05 Oct 2015 12:17:47 +0100] rev 48
Prevent instantiation of LLVMDIBuilder with #new
To prevent SIGSEGVs. LLVMDIBuilder can only be instantiated on a module,
so one must use #newForModule:
Jan Vrany <jan.vrany@fit.cvut.cz> [Tue, 29 Sep 2015 17:00:22 +0100] rev 47
Updated README.md
Added section on prerequisites and how to build LLVM C Extension library
Jan Vrany <jan.vrany@fit.cvut.cz> [Fri, 25 Sep 2015 21:57:05 +0100] rev 46
Removed dependency on SUnit
Jan Vrany <jan.vrany@fit.cvut.cz> [Fri, 25 Sep 2015 03:55:50 +0100] rev 45
Config: allow setting path to `llvm-config` via environment
...variable LLVM_CONFIG. This can be used to point standalone tools
to custom LLVM builds.
Jan Vrany <jan.vrany@fit.cvut.cz> [Wed, 23 Sep 2015 22:20:52 +0100] rev 44
IR Builder: Added #positionBefore:
to allow inserting instructions in the middle of basic block. This may
be handy during code generation, for example to insert allocas to
the beginning of the function.
Jan Vrany <jan.vrany@fit.cvut.cz> [Fri, 18 Sep 2015 06:19:28 +0100] rev 43
Added value-kind testing functions to LLVMValue
so once can test whether the value #isFunction, #isInstruction, #isReturnInst and so on.
Automatically LLVMValue to LLVMFunction (in LLVMValue>>initialize)
Jan Vrany <jan.vrany@fit.cvut.cz> [Thu, 17 Sep 2015 17:17:56 +0100] rev 42
Fixed LLVMExamples>>example7_factorial_with_debug_info
Pass DIFile instead of DICompileUnit to #createTypeFunctionIn:parameterTypes:
Fixed #createParameterVariable: - parameters are numbered starting with 1.
Jan Vrany <jan.vrany@fit.cvut.cz> [Thu, 17 Sep 2015 17:09:43 +0100] rev 41
Added testing and assestion methods to test metadata nodes for their type
...such as DIFile, DILocalVariable. These should be used by the Smalltalk API to make
sure it passes valid data to the C library. Otherwise the behaviour is undefined :-)
(except for Debug+Assert LLVM builds which calls abort(), not nice in Smalltalk context)
Jan Vrany <jan.vrany@fit.cvut.cz> [Thu, 17 Sep 2015 07:28:46 +0100] rev 40
Added LLVMMetadataKind enum/pool and LLVMGetMetadataKind()
This may be used by Smalltalk code to retrive concrete type of metadata node
such as DILocation, DIFile and so on.
Jan Vrany <jan.vrany@fit.cvut.cz> [Wed, 16 Sep 2015 06:29:15 +0100] rev 39
Updates to C callouts
Make all LLVMIsA*() functions to return bool rather than LLVMValue. According to documentation,
the function return NULL if the passed LLVMValue cannot be casted.
As the intention on a Smalltalk level is to do a type-test, this way we'd spare LLVMValue allocation
as well as following nil test.
Jan Vrany <jan.vrany@fit.cvut.cz> [Wed, 16 Sep 2015 05:32:46 +0100] rev 38
Added LLVMIRBuilder>>block returning current insertion block
This block is remembered in IR builder instance to spare creation of a new
block via LLVMGetInsertBlock().
Jan Vrany <jan.vrany@fit.cvut.cz> [Mon, 14 Sep 2015 11:12:31 +0100] rev 37
Add assertion to LLVMModule>>newWithName: to check for nil name. Fixed skip-in-debugger pragma (typo)
Jan Vrany <jan.vrany@fit.cvut.cz> [Sun, 13 Sep 2015 07:27:07 +0100] rev 36
Fixed LLVMConfig to handle lying `llvm-config --libdir`
On recent Debian Jessie builds from http://llvm.org/apt/jessie/
it seems that `llvm-config-3.8 --libdir` returns non-existent
directory.
To workaround this, check for returned libdir existence and if does
not exists, perform some guesswork. It guesswork does not help,
throw an error.
Jan Vrany <jan.vrany@fit.cvut.cz> [Thu, 03 Sep 2015 07:41:41 +0100] rev 35
Added LLVMModule>>getFunctionNamed:
Jan Vrany <jan.vrany@fit.cvut.cz> [Wed, 02 Sep 2015 21:46:58 +0100] rev 34
Fixed LLVMType>>dumpString
...so it does not raise a DNU.
Jan Vrany <jan.vrany@fit.cvut.cz> [Mon, 17 Aug 2015 08:53:26 +0100] rev 33
Initial support for generating (DWARF) debug info.
The current API is really horrible and clumsy, but it's more or less
1-to-1 mapping to LLVM API. LLVMExamples>>example7_factorial_with_debug_info
shows how to use it. The debug info API (at the Smalltalk level) will be
refactored to provide easier-to-use interface.
Jan Vrany <jan.vrany@fit.cvut.cz> [Mon, 17 Aug 2015 09:16:53 +0100] rev 32
LLVM C API Extensions: fixed LLVMDIBuilderInsert*AtEnd() functions for LLVM 3.8
Apparently in LLVM 3.8 passing nullptr as DILocation is not permitted any longer.
Add DILocatin parameter to these functions. Add LLVMGetDebugLocation2() to extract
current debug location from IR builder.
Jan Vrany <jan.vrany@fit.cvut.cz> [Mon, 17 Aug 2015 09:14:38 +0100] rev 31
LLVM C API Extensions: added utility conversion/data extraction routines
* to convert metadata to values and vice-versa.
* to extract bit-width from integer types.
These comes handy when generating debug information.
Jan Vrany <jan.vrany@fit.cvut.cz> [Mon, 17 Aug 2015 09:08:47 +0100] rev 30
LLVM C API Extensions: added llvm-c-ext/DWARF.h with (some) DWARF constants required to generate debug info.
Most importantly, DWARF encoding used when describing a variable to tell the debugger
how to interpret the data (as float, signed/unsigned int, etc). More constants will be
added as needed.
Jan Vrany <jan.vrany@fit.cvut.cz> [Thu, 13 Aug 2015 06:21:00 +0100] rev 29
Added bindings to LLVM C API Extensions library.
Jan Vrany <jan.vrany@fit.cvut.cz> [Thu, 13 Aug 2015 06:19:28 +0100] rev 28
Renamed LLVMBuilder to LLVMIRBuilder
to make naming consistent with coming LLVMDIBuilder
Jan Vrany <jan.vrany@fit.cvut.cz> [Fri, 14 Aug 2015 06:26:02 +0100] rev 27
LLVM type system refactored to use a subclass per kind.
This models LLVM types bit more object-oriented as type-specific methods such as
access to parameter/member types is implemented in specific classes only.
The FFI callouts still return a generic LLVMType, which later changes its class
during it's initialization (see LLVMType>>initialize).
Added some tests for types.
Jan Vrany <jan.vrany@fit.cvut.cz> [Wed, 12 Aug 2015 06:45:40 +0100] rev 26
Added DIBuilder API to LLVM C Ext library
The DIBuilder API is shamelessly copied & modified from
LLVM's GO bindings (see bindings/go/llvm in LLVM sources)
Jan Vrany <jan.vrany@fit.cvut.cz> [Wed, 12 Aug 2015 06:43:20 +0100] rev 25
Added LLVM's LICENSE.TXT to llvm_c_ext. Updated READMEs.
Jan Vrany <jan.vrany@fit.cvut.cz> [Mon, 10 Aug 2015 19:26:29 +0100] rev 24
Added support for intrinsics.
As access to intrinsics is not exposed by LLVM-C API, a custom C++ library
exposing those hase been added - llvm_c_ext. Smalltalk binds to this library
in addition to LLVM's.
In a future this library will expose whatever C++ API will be needed
in scope of this project. However, it's designed to usable standalone, i.e.,
it contains no Smalltalk-specic code.
Jan Vrany <jan.vrany@fit.cvut.cz> [Mon, 10 Aug 2015 10:33:42 +0100] rev 23
Added an example of iterative factorial function
It does not check for integer overflow as that would require using
an intrinsic (which are not yet supported)
Jan Vrany <jan.vrany@fit.cvut.cz> [Sat, 08 Aug 2015 04:43:00 +0100] rev 22
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz> [Fri, 07 Aug 2015 14:10:48 +0100] rev 21
Introduced class LLVMConfig to abstract a particular LLVM version
Jan Vrany <jan.vrany@fit.cvut.cz> [Wed, 05 Aug 2015 23:59:59 +0100] rev 20
Added inspector tab to show generated assembly for a module
as generated by LLVM's `llc` static compiler.
Jan Vrany <jan.vrany@fit.cvut.cz> [Wed, 05 Aug 2015 22:39:52 +0100] rev 19
Refactored 'Hello World' example to ise GEP.
This way, the example is statically-compilable by `llc` compiler.
Jan Vrany <jan.vrany@fit.cvut.cz> [Mon, 03 Aug 2015 21:25:56 +0100] rev 18
Oops, fixed #example3_hello_world
Of course, expansion \n is done by the C compiler, not the
printf() function...
Also fixed return type so function prototype matches the ret insn type.
Jan Vrany <jan.vrany@fit.cvut.cz> [Mon, 03 Aug 2015 20:47:52 +0100] rev 17
Use uint64 FFI type for `long long unsigned int` parameters
...as long FFI type maps to int32_t on 32bit system and to int64_t on
64bit system.
Jan Vrany <jan.vrany@fit.cvut.cz> [Mon, 03 Aug 2015 18:08:14 +0100] rev 16
Tests refactored to be actually a testcase. Introduced LLVMConstant class
as a factory for LLVM constant values (such as integer or string constants)
Jan Vrany <jan.vrany@fit.cvut.cz> [Tue, 04 Aug 2015 07:21:26 +0100] rev 15
Added license.txt
Jan Vrany <jan.vrany@fit.cvut.cz> [Sat, 01 Aug 2015 07:07:46 +0100] rev 14
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz> [Sat, 01 Aug 2015 06:21:29 +0100] rev 13
Renamed class categories to begin with LLVM-S
...to allow eventual port to Squeak/Pharo. Monticello would require that.
Jan Vrany <jan.vrany@fit.cvut.cz> [Fri, 31 Jul 2015 16:21:29 +0100] rev 12
Package renamed from jv:libllvms to jv:llvm_s
Jan Vrany <jan.vrany@fit.cvut.cz> [Fri, 31 Jul 2015 16:02:39 +0100] rev 11
Updated LLVM to use LLVM 3.8
Jan Vrany <jan.vrany@fit.cvut.cz> [Sat, 18 Jul 2015 07:22:20 +0100] rev 10
Added simple example of calling function defined within the same module.
Jan Vrany <jan.vrany@fit.cvut.cz> [Fri, 17 Jul 2015 17:20:04 +0100] rev 9
Added basic support for calling functions.
Jan Vrany <jan.vrany@fit.cvut.cz> [Fri, 17 Jul 2015 12:40:26 +0100] rev 8
Added class LLVMExamples
...with low-level examples how to use LLVM
Jan Vrany <jan.vrany@fit.cvut.cz> [Fri, 17 Jul 2015 12:38:30 +0100] rev 7
Fixed disposal of LLVMExecutionEngine
LLVMDisposeExecutionEngine() calls underlying module's desctructor. Therefore
LLVMExecutionEngine must keep a reference to the module and invalidate it
upon it's disposal.
Jan Vrany <jan.vrany@fit.cvut.cz> [Sun, 12 Jul 2015 08:34:51 +0100] rev 6
Added LLVMBuilder>>or:and:
Jan Vrany <jan.vrany@fit.cvut.cz> [Sat, 11 Jul 2015 16:56:36 +0100] rev 5
Temporary commit
Jan Vrany <jan.vrany@fit.cvut.cz> [Sat, 11 Jul 2015 10:03:12 +0100] rev 4
Temporary commit
Jan Vrany <jan.vrany@fit.cvut.cz> [Sat, 11 Jul 2015 06:38:54 +0100] rev 3
Lazy-initialize X86 target
Jan Vrany <jan.vrany@fit.cvut.cz> [Sat, 11 Jul 2015 06:38:00 +0100] rev 2
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz> [Thu, 09 Jul 2015 09:05:55 +0100] rev 1
Introduced abstract superclasses LLVMObject and LLVMDisposableObject
LLVMDIsposableObject disposes underlying C object when iit get collected.
Jan Vrany <jan.vrany@fit.cvut.cz> [Tue, 07 Jul 2015 23:11:41 +0100] rev 0
First shot.