[LLVMdev] newbie question - selecting the write kind of pass

Sameer D. Sahasrabuddhe sameerds at it.iitb.ac.in
Sat Apr 2 02:40:13 PST 2005


I want to create a simple map from a Value to the instruction that
defines it. Such a map is present inside SchedGraph, but I need it in
a much simpler context.

If I got it right, I create a new AnalysisGroup, and write a pass that
implements it. What kind of pass should I derive it from? The mapping
only makes sense within a function, so FunctionPass seems to be the
right choice ... is that correct?

The documentation says that "a FunctionPass is not allowed to retain
state across functions. What does that imply for an Analysis pass
derived from FunctionPass? Since all passes will act on one function
at a time, the life of the analysis will be handled correctly, right?

Sameer.
-- 
Research Scholar, KReSIT, IIT Bombay
http://www.it.iitb.ac.in/~sameerds/




More information about the llvm-dev mailing list