Machine code from textual c code at runtime.


I studied clang, saw the libclang but I am not sure if what I want can be worked out that way.

My need : Create textual C code (in char array) from a running application, and send it to a clang library, which would give me machine code back.

I guess I will have an AST that I will then have to throw at llvm, but the mechanism is not clear to me.

Could you help ?