سؤال

I am new to LLVM IR, I have a LLVM IR source code and it uses some extern declare functions. These functions are implemented in a C++ file.

So my question is :

How to call these c++ function in the LLVM IR?

Is it right way to compile the c++ file into LLVM IR, and link them together?

هل كانت مفيدة؟

المحلول

Assuming the llvm IR declarations are ABI compatible with your C++ compiler you should be able to compile the C++ to a native object file, compile the LLVM IR to a native object file, and link them using the native linker

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top