llvm - Pass arguments to a pass
Asked Answered
V

1

3

I need to tell the pass to look out for a specific function in the file. And I want to specify which function to look out for 'on the go' i.e when I run the pass. Any idea how I can do that? It's sort of like passing arguments to a function in theory.

Villus answered 23/2, 2018 at 18:32 Comment(0)
F
3

Add a command line option using cl::opt<string> and set it when running your pass.

Alternatively, if you are producing an IR from C or C++ using clang, you can utilize __attribute((__annotate__(("foo")))) to mark functions you are interested in.

Forelady answered 24/2, 2018 at 7:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.