(no title)
piroux | 10 years ago
https://gist.github.com/piroux/a856aa31525ca23238be
It can directly run with lli:
$ lli basics_array.ll
Note: I called it DynArray because I wanted it to grow itself when its nominal capacity would have been reached, but I never took the time to implement this feature ...
For instance, the prototype of the function adding an element could be :
define void @DynArrayI__add(%DynArrayI* %dynarray, i64 %elt)
You might need to add a capacity field to the type of DynArrayI and update others functions, to take it into account.
But according to me it is doable, even for a beginner, because the code is entirely written in LLVM.
So feel free to try !
No comments yet.