Skip to content

Commit

Permalink
fix a llvm compilation error due to header file reshuffle
Browse files Browse the repository at this point in the history
llvm upstream https://reviews.llvm.org/D119723 removed
header file llvm/DebugInfo/DWARF/DWARFCompileUnit.h from
llvm/DebugInfo/DWARF/DWARFContext.h and this
caused bcc compilation failure:

  ...
  .../src/cc/bcc_debug.cc: In member function ‘void ebpf::SourceDebugger::dump()’:
  .../src/cc/bcc_debug.cc:186:69: error: no matching function for call to
   ‘llvm::DWARFContext::getLineTableForUnit(llvm::DWARFCompileUnit*&)’
     const DWARFLineTable *LineTable = DwarfCtx->getLineTableForUnit(CU);
                                                                     ^
  In file included from /home/yhs/work/bcc/src/cc/bcc_debug.cc:22:
  ...

Similar to fix in https://reviews.llvm.org/D119723, let us explicitly
add llvm/DebugInfo/DWARF/DWARFCompileUnit.h in the .cc file.

Signed-off-by: Yonghong Song <[email protected]>
  • Loading branch information
yonghong-song committed Feb 17, 2022
1 parent 20fd1c8 commit e4d899c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cc/bcc_debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
#include <tuple>
#include <vector>

#if LLVM_MAJOR_VERSION >= 15
#include <llvm/DebugInfo/DWARF/DWARFCompileUnit.h>
#endif
#include <llvm/DebugInfo/DWARF/DWARFContext.h>
#include <llvm/DebugInfo/DWARF/DWARFDebugLine.h>
#include <llvm/IR/Module.h>
Expand Down

0 comments on commit e4d899c

Please sign in to comment.