Generated function call

Hi all,

I tried to twist a bit the AST by turning a very simple statement into a function and invoking in a statement as follows

void caller() { global_var++; }

===>

void _implicit_body() { global_var++; } // _implicit_body added into the translation unit via addDecl

void _implicit_invoker(void *f) {
void (fptr)() = (void()()) f;
fptr();
}

void caller() {
_implicit_invoker((void*)implicit_body); // CallExpr
}

The generated AST looks fine. However the generated code is broken since there is no code generated for function _implict_body. I am wondering if there is a way to mark a function such that codegen always generates code for this function.

Thanks,

Wei