Skip to content

Update to Newer LLVM Versions

Philipp Schubert edited this page Mar 19, 2021 · 11 revisions

The Purpose of This Page

This page is intended to give PhASAR's users an easier time to follow LLVM updates. We try to keep up to date with LLVM's most recent stable version. Users of PhASAR are therefore also required to update their code.

In the following, we report on the major changes that we had to make to PhASAR to keep it compatible with the most recent LLVM version. This information should provide useful insights to users that also need to update their code base. LLVM's changelog can be found here: https://releases.llvm.org/download.html---check out the release notes for the respective version.

Update From LLVM-10 to LLVM-11

The most prominent API change involves the handling of call sites. Rather than analyzing call sites using the llvm::ImmutableCallSite type in code similar to what follows:

const llvm::Instruction *I = /* some instruction */;
if (llvm::isa<llvm::CallInst>(I) || llvm::isa<llvm::InvokeInst>(I)) {
  llvm::ImmutableCallSite CS(I);
  // analyze CS
}

users now have to use the llvm::CallBase type instead:

const llvm::Instruction *I = /* some instruction */;
if (const auto *CB = llvm::dyn_cast<llvm::CallBase>(I)) {
  // analyze CB
}

Please check https://llvm.org/doxygen/classllvm_1_1CallBase.html for details on llvm::CallBase.

Clone this wiki locally