Adapt jit-rt to LLVM 9

This commit is contained in:
Martin Kinkelin 2019-09-21 01:45:00 +02:00
parent 030123410a
commit 0ab79c1950
3 changed files with 14 additions and 1 deletions

View file

@ -323,7 +323,13 @@ void disassemble(const llvm::TargetMachine &tm,
if (object.section_end() != secIt) {
const auto sec = *secIt;
llvm::StringRef data;
#if LDC_LLVM_VER >= 900
auto dataOrError = sec.getContents();
assert(dataOrError);
data = *dataOrError;
#else
sec.getContents(data);
#endif
if (llvm::object::SymbolRef::ST_Function ==
llvm::cantFail(symbol.getType())) {