First of all, there are no virtual functions involved - C does not have such a concept. I think what you mean is an indirect function call, that is, getting a function pointer and invoking the function it is pointing to.
The short answer is that no, there's no straightforward way to embed LLVM IR in C and getting it to compile with your code: see this related question and my answer. As I mention there, if you want to allow the programmer to write LLVM IR and still stick with direct function calls, you should encapsulate the IR in a function and put it in a separate file.
If embedding IR is more important than performance, you'll have to go with the ParseIR()
route (no need for ParseIRFile()
- you can parse directly from memory).
I guess that you could introduce some script to your build process which takes a hybrid C/IR input file, splits it into two files and then compiles them together, and modifies the debug information in the IR appropriately to behave as if it was truly embedded in the C file. But that is an extremely hacky approach, and in either way that input file will not be a legal C file.