3

let's say I have some logic written down in some programming language with LLVM frontend available. I would like to reuse this logic in some c++ application. Can I generate some sort of library using common LLVM backends and call it from my application without significant loss of performance? Any hints on how to address this usecase?

Szymon Brych
  • 111
  • 2
  • 10
  • You want to generate library for only one time, and then use it without LLVM (you can compile the code to the library by llvm and link it into your application)? Or you want to be able modify and recompile the logic on the fly (then you must integrate LLVM JIT into your application)? Please, give some details about this logic and used language – osgx Feb 05 '15 at 14:25
  • Former. I have some legacy codebase which has some portion of logic that needs to be reused in cpp application. From what I learnt so far I could transcompile legacy to IR and then use:llc -march=cpp -o code.cpp code.ll and from that point use it as any regular CPP right? Now I know it won't be pretty, but as long as Api is intact I don't really need to look inside. – Szymon Brych Feb 05 '15 at 15:18
  • Is your target one platform or many? For single target platform (for example, x86_64/linux) you may compile the legacy code with llvm into binary object and link with it. For several you should compile the *.ll into multiple object files. – osgx Feb 05 '15 at 15:56

0 Answers0