How to generate LLVM IR code to call C++ STL function?

254 Views Asked by At

I want to generate LLVM-IR that contains a call to a C++ STL function. e.g. std::sort(). I think I need to go through following steps to achieve the task.

  1. Link std::sort() into the IR
  2. Get a reference to function std::sort()
  3. Create a call to std::sort() using IRBuilder.CreateCall(~).

I'm not sure how to achieve the first step above.

0

There are 0 best solutions below