[llvm-dev] Risc-v Assembly printer function order

'Irenee GROZ IG255340' via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 7 00:54:02 PDT 2018


Hello,

I am working on the assembly printer for RISC-V, more specifically on 
the AsmPrinter class.
I altered the RISCV Backend to print C code instead of Assembly, 
interpreted by libraries... (but that's not important)
My problem is that, for my application to work, I need to treat my 
functions in the order they are in the original C file.
I discovered that these functions are not treated in this order.

My question is : Is there a way to force llvm to treat the functions in 
the order given in the original C file ? and how?

I treat each function in the EmitFunctionBody funtion of the AsmPrinter 
class, and the function is passed through the MachineFunction passed 
trhough the runOnMachineFunction function. I didn't find where this last 
function is called.
So I wish maybe to alter the way this function is called for each 
Function to call it in the "right" order...

Thanks,
Best regards,
IG



More information about the llvm-dev mailing list