Placeholders in the target data layout

Hello,

I have to use the target data layout for my compiler to make the native linker work. But the target data layout is target specific. My bitcode file should not be. The only critical thing in the layout is the pointer size: “p:32:32” vs “p:64:64”. Is there a way to use placeholders to insert the bit width of a pointer at a very late stage? It would be uncool when the platform independence of a bitcode file fails at one single line.

Cheers

Hi Carl-Philip,

I have to use the target data layout for my compiler to make the native linker
work. But the target data layout is target specific.

so is the native linker, presumably. What are you trying to do exactly?

  My bitcode file should not

be. The only critical thing in the layout is the pointer size: "p:32:32" vs
"p:64:64". Is there a way to use placeholders to insert the bit width of a
pointer at a very late stage?

You can simply not provide a target layout initially, and add it when you are
about to do something target specific (see setDataLayout and setTargetTriple
in Module.h).

Ciao, Duncan.

  It would be uncool when the platform independence