RF_IgnoreMissingEntries renamed to RF_IgnoreMissingLocals in LLVM

added workaround to build with both symbols
This commit is contained in:
Rainer Schuetze 2016-04-16 09:50:58 +02:00
parent 7c04eabd6e
commit 08e4b13b23

View file

@ -55,14 +55,27 @@ void findSuccessors(std::vector<llvm::BasicBlock *> &blocks,
}
}
// temporary mapping to either RF_IgnoreMissingEntries or RF_IgnoreMissingLocals
// that has been renamed during LLVM 3.9 development
// TODO: remove once appveyor builds are updated to newer LLVM prebuilt libs
struct RF_IgnoreMissing {
template <typename C> struct _entries { static const auto value = C::RF_IgnoreMissingEntries; };
template <typename C> struct _locals { static const auto value = C::RF_IgnoreMissingLocals; };
template <typename C> static _entries<C> test(decltype(C::RF_IgnoreMissingEntries)*) {}
template <typename C> static _locals<C> test(...) {}
static const auto value = decltype(test<llvm::RemapFlags>(nullptr))::value;
};
// remap values in all instructions of all blocks
void remapBlocks(std::vector<llvm::BasicBlock *> &blocks,
llvm::ValueToValueMapTy &VMap, llvm::BasicBlock *unwindTo,
llvm::Value *funclet) {
for (llvm::BasicBlock *bb : blocks)
for (llvm::BasicBlock::iterator I = bb->begin(); I != bb->end(); ++I) {
llvm::RemapInstruction(&*I, VMap, llvm::RF_IgnoreMissingEntries |
llvm::RF_NoModuleLevelChanges);
llvm::RemapInstruction(&*I, VMap, RF_IgnoreMissing::value |
llvm::RF_NoModuleLevelChanges);
}
}