[LLVMdev] Target Assembly Parser: Access to Reloc::Model

Matheus Almeida Matheus.Almeida at imgtec.com
Tue Feb 25 08:31:10 PST 2014


Some Mips macros (e.g. la[1]) and the handling of Mips directives used for Position-Independent Programming (e.g. .cpload[2]) require access to Reloc::Model from within the Assembly Parser but there doesn't seem to be a way to do it in its current form.
  1) Reloc::Model is passed to MCObjectFileInfo but it's a private member of that class
  2) TargetMachine is not accessible

I can also see that clang initializes MCObjectFileInfo with Reloc::Default which isn't entirely right but that's a different matter. I'll come back to that later after we decide what's the right approach to fix this issue.

Any suggestions about the right way to expose the relocation model to the assembly parser ?

[1] la - load address. Roughly speaking this macro expands to a GOT access if generating PIC or to an absolute access if not .
[2] .cpload - This directive sets up $gp (Global Pointer) if PIC or it can be ignored for the static model.

Regards,
Matheus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140225/ac35136f/attachment.html>


More information about the llvm-dev mailing list