Skip to content

How to add a plugin when compiling an entire codebase #58

@vjpr

Description

@vjpr

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.

clang++ -flegacy-pass-manager -Xclang -load -Xclang ./libmypass.so input.cpp

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions