llir / llvm

Library for interacting with LLVM IR in pure Go.
https://llir.github.io/document/
BSD Zero Clause License
1.19k stars 78 forks source link

irutil: data layout configuration #189

Closed dannypsnl closed 3 years ago

dannypsnl commented 3 years ago

It would be good to implement parsing and handling of data layout strings, building upon this API, and add such functionality to irutil.

mewmew commented 3 years ago

ref: #66

mewmew commented 3 years ago

This issue requires parsing the LLVM data layout string to determine the memory layout, so we can handle padding of struct fields and array elements. Having implemented parsing of LLVM data layout strings, implementing support for composite types for the irutil.Layout interface should be rather straight forward.

svvivek commented 3 years ago

It would be good to implement parsing and handling of data layout strings, building upon this API, and add such functionality to irutil.

I have tried writing one, please check it out @ https://github.com/llir/irutil/pull/4

svvivek commented 3 years ago

It would be good to implement parsing and handling of data layout strings, building upon this API, and add such functionality to irutil.

I have tried writing one, please check it out @ llir/irutil#4

Now that the PR is merged, this issue can be closed right ?

mewmew commented 3 years ago

Now that the PR is merged, this issue can be closed right ?

Indeed. Great work1

We can now add methods to the irutil.DataLayout to implement the irutil.Layout interface.

Have a great week :) Happy wishes from Sweden.

Cheers, Robin