Transfer between function passes

Hello
I need to transfer data(array of structures) between 2 llvm function passes.

One of the passes runs during optimization phase(the array is generated during this phase), another one runs during code generation phase.
How can it be implemented?(I don`t want to transfer the array as an argument to the function pass of code generation phase)
Thank you.

Yakov

Hi Yakov,

I need to transfer data(array of structures) between 2 llvm function passes.
One of the passes runs during optimization phase(the array is generated during
this phase), another one runs during code generation phase.
How can it be implemented?(I don`t want to transfer the array as an argument to
the function pass of code generation phase)
Thank you.

you could inject the information into the module as metadata, or as a special
global variable like llvm.global_ctors or llvm.used.

Ciao, Duncan.