Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to use LLVM Pass module in Solang? #517

Open
UESuperGate opened this issue Oct 8, 2021 · 7 comments
Open

Is it possible to use LLVM Pass module in Solang? #517

UESuperGate opened this issue Oct 8, 2021 · 7 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@UESuperGate
Copy link

Hi there!

I'm curious about whether Solang supports loading LLVM Pass module to perform some preprocessing on the generated LLVM-IR.

For instance, we can use LLVM Pass module in clang like this:
clang -Xclang -load -Xclang ../build/PlacementPass/libLLVMPassname.so demo.c -o demo

Can Solang do the same thing?

@seanyoung seanyoung added the enhancement New feature or request label Oct 8, 2021
@seanyoung
Copy link
Contributor

As solang uses llvm, there is no reason why it should not support it. Right now it does not have the command line options and the hooks to make this happen though.

For what reason are you interested in this? Is there specific pass you have in mind?

@UESuperGate
Copy link
Author

There are already smart contract vulnerability detection and automatic repair solutions. I'm thinking about that if we can use LLVM to compile smart contract source code, we can add these features to LLVM Pass module, which can be used in the process of compiling.

Some general optimization schemes on Solidity can also be applied to LLVM Pass, by the way.

@seanyoung
Copy link
Contributor

Ok, interesting. Do you have a specific pass in mind?

@UESuperGate
Copy link
Author

I found a pretty interesting paper which provides a vulnerability detection method based on a series of well-defined dependency rules, and the corresponding patch scheme.

Therefore, I will try to optimize and port this set of programs to LLVM Pass though it's just a idea in my mind for now.

@seanyoung
Copy link
Contributor

ok. The reason I ask for a specific pass is that a) there is a something to test and develop against and b) there is a specific benefit today.

@UESuperGate
Copy link
Author

Got it. Thanks for your reply!

@seanyoung
Copy link
Contributor

Let me know if you make any progress writing the pass, I'll will look at adding this to solang when needed.

@seanyoung seanyoung added the help wanted Extra attention is needed label Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants