Closed DrGo closed 8 months ago
Hi,
I think you might have misunderstood Terra.
Terra parses C headers using Clang. We use Clang to generate LLVM IR. So the path looks something like: Clang -> LLVM IR -> machine code.
If you're compiling Terra at the same time, the path is: Terra -> LLVM IR -> machine code.
If you have mixed C/Terra modules, we combine those at the LLVM IR level so that LLVM can optimize them together.
However, if you want to get back to source code, what you're talking about is basically decompiling LLVM IR. There are definitely tools that do that, but Terra is not one of them.
Hope that helps.
Yes. Very helpful and it makes a lot of sense...
Has anyone tried to use Terra to transpile a fairly complex c lib to Rust or Go?
What would be the general approach and possible obstacles? I am not familiar with Terra. Thanks,