[LLVMdev] How to force a MachineFunctionPass to be the last one ?

Andrew Trick atrick at apple.com
Tue Jan 21 19:03:18 PST 2014


On Jan 21, 2014, at 5:12 PM, Juergen Ributzka <juergen at apple.com> wrote:

> Please don’t yell at me Pete, but I already did that with the StackMapLiveness pass :P
> Although the pass only touches STACKMAP and PATCHPOINT instructions, so it shouldn’t be an issue.

That doesn’t really count since we’re only “annotating” the instruction with a register mask. For the purpose of code emission it’s just metadata.
-Andy

> Cheers,
> Juergen
> 
>  
> On Jan 21, 2014, at 4:39 PM, Pete Cooper <peter_cooper at apple.com> wrote:
> 
>> You can add your pass to the end of
>> 
>> X86PassConfig::addPreEmitPass()
>> 
>> and it will currently be the last thing to run before the asm printer, but I don’t know if thats a guarantee or not.  
>> 
>> In theory anyone could add something after the call to preEmitPass and before this code
>> 
>> FunctionPass *Printer = getTarget().createAsmPrinter(*this, *AsmStreamer);
>> PM.add(Printer);
>> 
>> but if they do you can shout loudly :)
>> 
>> Thanks,
>> Pete
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140121/ca024762/attachment.html>


More information about the llvm-dev mailing list