I’m trying to generate LLVM-IR that calls a function from C++ STL (e.g.
std::sort() ) .
I need to perform the following steps.
- Check whether
std::sort() is available in the build environment.
- Create a call to
May I ask for advice on how to perform the 1st step above?
std::sort, like most STL function can’t be just “available in the build environment”: these are templated functions that needs to be instantiated for C++ types, and then dispatch to a comparison operator that depends on the C++ types.
You would have better chance looking for C-library level functions, like
@JOE1994 , @mehdi_amini
I want to call a c or c++ function in LLVM IR. Do you have any idea about that? I’d appreciate it if you can provide an example.
This looks like a duplicate of How to call c++ code in LLVM IR.