[LLVMdev] Changing the Function Prototype of all functions in the bitcode
Santosh Nagarakatte
santosh.nagarakatte at gmail.com
Fri Feb 25 11:45:10 PST 2011
Hi all,
I am trying to change the prototype of all functions in the bitcode.
Specifically I want to add an extra argument to all functions
definitions and call sites. What is the best way to accomplish this
using the LLVM API?
Currently I accomplish this by using a module pass which iterates
over all the functions in the module.
For each function, I create a new function with an extra argument.
Subsequently I iterate over all the uses of the function and change
the callsites to pass an extra argument.
Currently I am facing two problems.
1) Handling indirect function calls this way causes inconsistency in
the bitcode.
2) I need to change every function pointer type in the program.
For ex a struct with function pointer needs to have the new function
pointer type
I don't know if there is a good way to do this.
I was wondering if there is any better way to accomplish the same.
Thanks,
Santosh
--
Santosh G Nagarakatte,
PhD Student,
Computer and Information Science Department
University of Pennsylvania,
Philadelphia-19104
http://www.cis.upenn.edu/~santoshn
More information about the llvm-dev
mailing list