How can I change clang to compile a.ll file in a language that I specify (not one that clang can compile now)?

In my project, I need to compile a specific language into llvm IR, and I want to be able to do this through clang.
But that language is not the target language for clang. How can I rewrite clang?

This is really a problem for me, is there a case or tutorial that I can recommend for similar functions?


Depending on the target language, you can use ‘-x’. For example, -x c++ and -x c compile in C++ and C respectively. I think -x objc is another option as well, but I’m less sure about that one.