[llvm-dev] Conflicts with custom passes
Tim Northover via llvm-dev
llvm-dev at lists.llvm.org
Sat Jun 29 01:44:19 PDT 2019
On Sat, 29 Jun 2019 at 05:45, Kihong Heo <kihong.heo at gmail.com> wrote:
> I am wondering how out-of-tree LLVM pass is robust. I am building my custom pass on one machine and want to run this for other machines (e.g., Docker images).
> I notice that LLVM IR’s OPCode is different from versions. Also it seems that type matching (e.g., if (llvm::CallInst *CI = llvm::dyn_cast<llvm::CallInst>(&I))) does not work well another machine. But I am not sure whether my guess is correct or not.
You're right, LLVM's C++ API has no stability guarantees and will
almost certainly change between major versions. Your pass will have to
be compiled against the same version of LLVM it will use to run, and
with compatible build settings (e.g. RTTI is an issue, and there is an
LLVM_ENABLE_ABI_BREAKING_CHECKS Cmake variable).
More information about the llvm-dev