ORC name mangling


I’d like to make sure my understanding of the name mangling in the ORC examples is correct.

In the ORC lazy examples, each function gets IR’ed into its own separate LLVM module, and each module is compiled separately. So, in the name resolver, all functions need to be resolved by their mangled name, as they are linked with external linkage.

I’m still not clear on what exactly performs the name mangling. Say I build an LLVM module that has the following function definition

define double @test(double %x) …

And then I compile this to object code, where exactly is the name mangling performed, i.e. creating a RuntimeDyld that has a symbol called “_test”?