fix a llvm compilation error due to header file reshuffle 30/294730/1
authorYonghong Song <yhs@fb.com>
Thu, 17 Feb 2022 16:38:28 +0000 (08:38 -0800)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Fri, 23 Jun 2023 20:06:04 +0000 (22:06 +0200)
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.

Change-Id: I528537d1cccfbeffb95ff7bccf926bed8eb41a78
Origin: upstream, https://github.com/iovisor/bcc/commit/e4d899ce335e263999c2664c9770c53018fc6c51
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
src/cc/bcc_debug.cc

index 77d681ac3de205274af4b2bc5efd4ed46a9dc3de..a7a865f4884d556f89c0755112ef0feaa72af251 100644 (file)
@@ -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>