Commit 02843254 authored by yonghong-song's avatar yonghong-song Committed by GitHub

fix compilation error with llvm trunk (8.0.0) (#1924)

LLVM commit https://reviews.llvm.org/D49741 removed
function DEARFContext::getCompileUnitAtIndex() and caused
the bcc compilation failure.

Change usage of getCompileUnitAtIndex() to the one
recommended in the above llvm commit.
Signed-off-by: default avatarYonghong Song <yhs@fb.com>
parent 3a932466
......@@ -154,7 +154,12 @@ void SourceDebugger::dump() {
}
// bcc has only one compilation unit
// getCompileUnitAtIndex() was gone in llvm 8.0 (https://reviews.llvm.org/D49741)
#if LLVM_MAJOR_VERSION >= 8
DWARFCompileUnit *CU = cast<DWARFCompileUnit>(DwarfCtx->getUnitAtIndex(0));
#else
DWARFCompileUnit *CU = DwarfCtx->getCompileUnitAtIndex(0);
#endif
if (!CU) {
errs() << "Debug Error: dwarf context failed to get compile unit\n";
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment