trailofbits / vast

VAST is an experimental compiler pipeline designed for program analysis of C and C++. It provides a tower of IRs as MLIR dialects to choose the best fit representations for a program analysis or further program abstraction.
https://trailofbits.github.io/vast/
Apache License 2.0
395 stars 25 forks source link

Create MLIR linker tool #83

Open xlauko opened 2 years ago

akshithg commented 1 year ago

@xlauko I'm interested in taking a shot at this, any help/direction you can provide me?

pgoodman commented 1 year ago

I strongly believe linking should be a process that queries an API to get answers about how to proceed, and should not bake in specific mechanics. So, for example, if two functions have the same name, then they are linking candidates, but an API call should tell us if we can actually substitute one for the other, or not. APIs should also advise on how to rename, if at all. Finally, types (especially typedefs) will be uniquely challenging. VAST's representation of typedefs are abstraction-breaking in some ways. Typedefs are associated with MLIRContext-deduplicated named types, but a variable of typedef type takes on a different meaning depending on its usage context, because there may be an typedef operation in scope that provides a definition.

lkorenc commented 1 year ago

Hi and thanks for taking interest in our project! :)

So this is a rather big task and there will be a bunch of interesting problems to solve, but one step at a time. Depending on how the progress goes we can later track separate sub-issues as separate github issues, but the course of action for now I would recommend is (each step can be one PR for example):

There is absolutely no reason to bother with super complex cases this early on, we will slowly get there naturally as code adds up. As for codestyle, we do not have a guideline right now I believe, just look at the code around :) There is CONTRIBUTING.md at the root of the project that gives rules on how git is used.

Feel free to ask questions, I am happy to help.

akshithg commented 1 year ago

Thanks for breaking this down for me @lkorenc. As a first task I'll look at other drivers and create the skeleton for vast-link that does the bare minimum arg parsing. Will reach out if something comes up :)

lkorenc commented 1 year ago

Hi,

is there any progress/problems we can help with?