aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoryonghong-song <ys114321@gmail.com>2018-08-13 13:37:22 -0700
committerGitHub <noreply@github.com>2018-08-13 13:37:22 -0700
commit02843254fb1a6ac5dab81b6b21ff0237b4bb0ffa (patch)
treec2f4a51d29c96bb144c16068998d2fe79c6c6dbc /src
parent3a932466a32288aae15c70d6de1c9d592a5dce45 (diff)
downloadbcc-02843254fb1a6ac5dab81b6b21ff0237b4bb0ffa.tar.gz
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: Yonghong Song <yhs@fb.com>
Diffstat (limited to 'src')
-rw-r--r--src/cc/bcc_debug.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cc/bcc_debug.cc b/src/cc/bcc_debug.cc
index 7c3dd1f9..786074a4 100644
--- a/src/cc/bcc_debug.cc
+++ b/src/cc/bcc_debug.cc
@@ -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;