-
Notifications
You must be signed in to change notification settings - Fork 364
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
How to add a plugin when compiling an entire codebase #58
Comments
Hello @vjpr , thanks for creating this issue and for your extensive research on this matter :)
Unfortunately, the Legacy PM will be removed after LLVM 14?
Good point! Do you have the bandwidth to create a PR? This would have to be added with the caveat that it will stop working once LLVM 15 is released. Sadly :( |
looks like it's never been resolved even though it's pretty old. I would like to add some of my finding I ran into the same issue while handling one of my recent project. After going through some of the recent llvm documentation, I figured out how to load a custom pass with the new pass manager to the default compilation pipeline the general command would look like this clang-17 -fpass-plugin=<pass plugin so> -fplugin=<pass plugin so> -mllvm -arg1=<val> src.cpp -o obj To explain what happened in the command above, Lastly, as the original post mentioned, the correct entry point needed to be used (e.g. |
Related
I am trying to instrument all function calls in an existing codebase.
I don't want to have to modify existing makefile scripts too extensively.
The solution is to use the legacy pass manager.
It seems that the new pass manager doesn't allow this yet.
You must take care to choose the correct extension point. See here are the extension points. See [here] (https://github.com/rdadolf/clangtool/blob/353b80061ce30c3062bbe4752dbaa2a1c84cc9c8/clangtool.cpp#L42-L49) for an explanation of which ones to use.
This information should be added to the readme.md.
The text was updated successfully, but these errors were encountered: