I'm using llvm-py for a month now and I wonder if there is any way to
add declaration on the fly.
What I'm doing now is:
file = open('base_decl.ll', 'r')
module = Module.from_assembly(file)
The declarations I want are known at compilation time, adding them on
the fly could save a static analysis pass.
Thank you for taking the time to answer my questions.
Cheers,
Lukasz
Declarations are just functions without any basic blocks. Create an
empty module (Module.new), then function types, and add functions of
that type. If you do not append any basic blocks to the functions,
they remain declarations.
HTH,
-Mahadevan.
> What I'm doing now is:
>
> file = open('base_decl.ll', 'r')
> module = Module.from_assembly(file)
>
> The declarations I want are known at compilation time, adding them on
> the fly could save a static analysis pass.
>
>
> Thank you for taking the time to answer my questions.
>
> Cheers,
> Lukasz
>
>
> --
> To unsubscribe, reply using "remove me" as the subject.
>