Yes, perhaps for some version of clang / llvm. You can start with http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/cc1_main.cpp?revision=126577&view=markup = this is the source of the clang binary itself. It calls the libclang library, and you can integrate this code into your application. (It actually uses unstable C ++ interfaces from the internal clang and llvm libraries, and not for the stable C libclang API.)
If you save all C sources in a file, thatβs all you need. But if you want to transfer sources directly through memory, you must write a custom SourceManager and set the CompilerInvocation Clang using the setSourceManager() method.
source share