Read :meta symbol before code generation

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Read :meta symbol before code generation

Theodoros Theodoridis

I've been been playing with Julia's internals (as part of my master's thesis) and I'm trying to do the following:

I want to to annotate functions with a flag that will be used during code generation. I've used the :meta mechanism for that: in codegen.cpp:emit_function after the call to jl_uncompress_ast I can use has_meta to check the existence of the symbol I'm interested in. 

However, my code is a layer that sits on top of code generation and in order to read that :meta symbol I'd have to uncompress the ast there as well. While I could do that (or something similar) I'd prefer something cleaner for example including a flag in the jl_lambda_info_t that is passed to the code generator (and also through my code) i.e. if(has_meta(code, symbol)) li->flag =1; .

Where would be the "best" place to insert that check?