[LLVMdev] Controlling the order of a FunctionPass

Trevor Harmon trevor.w.harmon at nasa.gov
Thu Jul 22 13:59:21 PDT 2010


Hi,

I would like my FunctionPasses to be invoked in reverse call graph  
order (callees before callers). However, "Writing an LLVM Pass" notes  
that "FunctionPass's do not require that they are executed in a  
particular order." Is there any way at all to specify an ordering?

If this is not possible, I'm thinking of a workaround in which my  
runOnFunction method does not actually process the function but  
instead copies the Function object to a "work set". When runOnFunction  
has been invoked for all functions, I would then perform the analysis  
on each saved function in the order that I desire. Does this sound  
like the right approach? (Note that my pass is analysis-only -- it  
does not modify the functions.)

Thanks,

Trevor




More information about the llvm-dev mailing list