Fix a llvm compilation error
authorYonghong Song <yhs@fb.com>
Wed, 26 May 2021 02:58:00 +0000 (19:58 -0700)
committeryonghong-song <ys114321@gmail.com>
Wed, 26 May 2021 03:37:27 +0000 (20:37 -0700)
commit5d77f50e929e4ee22b1dc08924960913e32d9e3b
treee5782924aed6fdb2ffebbe8261d22d20b7826c94
parent20061e8faec70c65507f4d50b73b542c7e0b9517
Fix a llvm compilation error

Current llvm trunk (https://github.com/llvm/llvm-project)
will cause the following compilation errors:
  /home/yhs/work/bcc/src/cc/bcc_debug.cc: In member function ‘void ebpf::SourceDebugger::dump()’:
  /home/yhs/work/bcc/src/cc/bcc_debug.cc:135:75: error: no matching function for call to
     ‘llvm::MCContext::MCContext(llvm::Triple&, std::unique_ptr<llvm::MCAsmInfo>::pointer,
      std::unique_ptr<llvm::MCRegisterInfo>::pointer, llvm::MCObjectFileInfo*,
      std::unique_ptr<llvm::MCSubtargetInfo>::pointer, std::nullptr_t)’
     MCContext Ctx(TheTriple, MAI.get(), MRI.get(), &MOFI, STI.get(), nullptr);
                                                                             ^
     ......

This is because upstream patch https://reviews.llvm.org/D101921
refactored MCObjectFileInfo initialization and changed MCContext
constructor signature.

This patch fixed the issue by following the new code patterns
in https://reviews.llvm.org/D101921.
src/cc/bcc_debug.cc