[LLVMdev] whether these transformations are doable and how?

Ning Wang neal.wang at gmail.com
Fri Apr 9 04:29:38 PDT 2010


Hi folk,

I'm a newbie to llvm, please first forgive my naive questions. I want to
instrument llvm code to do some run-time monitoring work.  After reading
some of the llvm documentation, it begins clear to me that I can do the
instrumentation in a transformation pass.   There are several things I want
to do in the transformation pass, but I'm not sure whether they are doable
and how to do them even after I read the documentation.  I would be very
appreciate if anyone can answer my questions or give me hints of how to do
them.

1.  can I add more global memory objects to a module?  any hint how to do
it?  do I need to derive a pass from ModulePass?
2.  can I add more stack allocated memory objects to a function?  the answer
seems yes, any hint how to do it?
3.  can I modify a function to take extra formal parameters? can I update
all calls of the original function to take extra actual paramters?  The
function might be called across multiple modules.   It seems this has to be
done at both ModulePass and FunctionPass levels.

Thanks,
Neal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100409/ac6b2977/attachment.html>


More information about the llvm-dev mailing list