[LLVMdev] MachineFunction::get

Jeffrey Yasskin jyasskin at google.com
Fri Nov 6 19:51:19 PST 2009


The proper incantation appears to be:

  MachineFunction &MF = getAnalysis<MachineFunctionAnalysis>().getMF();

I found that in lib/CodeGen/MachineFunctionPass.cpp. On the other
hand, that means it probably doesn't exist in a ModulePass, since the
MachineFunctionAnalysis is itself a FunctionPass, so any particular
Function's MachineFunction will only exist while that function is
being emitted.

On Fri, Nov 6, 2009 at 5:43 PM, Sumesh Udayakumaran <sumesh.uk at gmail.com> wrote:
> Hi
> I have a ModulePass in LLC that runs after most of codegen completes,
> right before OBJ emission.  I want the ModulePass to iterate over all
> MachineFunctions, emulating them.  I used to do this by iterating over
> all Module Function's, and using MachineFunction::get() to get the
> MachineFunction associated with said Function.
>
> In LLVM 2.6, MachineFunction::get() is gone.  What is the  new way  of
> doing what I need?
>
> thanks
> Sumesh
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>




More information about the llvm-dev mailing list