user2118561
user2118561

Reputation: 21

LLVM pass creation related

I want to create a pass that will insert a function (that is in some c file) after every load instruction.I know how to insert a function with no arguments.But a function that also have argument. I am not able to insert that.How should i do that? Thanks in advance.

Upvotes: 0

Views: 84

Answers (1)

Eli Bendersky
Eli Bendersky

Reputation: 273456

Use the CallInst::Create static method. It takes an ArrayRef of arguments. By grepping for this method call in the source of LLVM & Clang you can find many examples for using it.

Upvotes: 1

Related Questions