[LLVMdev] LLVM pass adding function call specific to Linux, middle-end or backend?
gael.jobin at switzerlandmail.ch
Thu Mar 19 01:55:18 PDT 2015
I have already developped some optimizer pass in the middle-end playing
with the LLVM IR.
Now, I would like to write a pass that are going to add some functions
calls that exist only on Linux system (both x86 and x64). I was
wondering about the right way to do it. Does LLVM offer any way to
obtain the current architecture in the middle-end (analysis pass maybe)?
If so, should I write this pass in the middle-end using the flexibility
of LLVM IR to add function call and some if/else branch to avoid
transformation on unsupported OS? Or should I write my pass somewhere
(where?) in the backend's specific part for Linux x86/x64 architecture?
Thank you for your help.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev