|
|
a6a04d |
From d74c96d9423652d4467339ee24bb6db2e5df21cb Mon Sep 17 00:00:00 2001
|
|
|
a6a04d |
From: Yonghong Song <yhs@fb.com>
|
|
|
a6a04d |
Date: Wed, 5 May 2021 19:11:13 -0700
|
|
|
a6a04d |
Subject: [PATCH 1/2] fix llvm compilation errors
|
|
|
a6a04d |
|
|
|
a6a04d |
MCContext and InitMCObjectFileInfo name/signatures
|
|
|
a6a04d |
are changed due to upstream patch
|
|
|
a6a04d |
https://reviews.llvm.org/D101462
|
|
|
a6a04d |
Adjust related codes in bcc_debug.cc properly to resolve
|
|
|
a6a04d |
the compilation error for llvm13.
|
|
|
a6a04d |
|
|
|
a6a04d |
Signed-off-by: Yonghong Song <yhs@fb.com>
|
|
|
a6a04d |
---
|
|
|
a6a04d |
src/cc/bcc_debug.cc | 9 +++++++--
|
|
|
a6a04d |
1 file changed, 7 insertions(+), 2 deletions(-)
|
|
|
a6a04d |
|
|
|
a6a04d |
diff --git a/src/cc/bcc_debug.cc b/src/cc/bcc_debug.cc
|
|
|
a6a04d |
index 371b6ad3..775c9141 100644
|
|
|
a6a04d |
--- a/src/cc/bcc_debug.cc
|
|
|
a6a04d |
+++ b/src/cc/bcc_debug.cc
|
|
|
a6a04d |
@@ -128,11 +128,16 @@ void SourceDebugger::dump() {
|
|
|
a6a04d |
return;
|
|
|
a6a04d |
}
|
|
|
a6a04d |
|
|
|
a6a04d |
+ std::unique_ptr<MCSubtargetInfo> STI(
|
|
|
a6a04d |
+ T->createMCSubtargetInfo(TripleStr, "", ""));
|
|
|
a6a04d |
MCObjectFileInfo MOFI;
|
|
|
a6a04d |
+#if LLVM_MAJOR_VERSION >= 13
|
|
|
a6a04d |
+ MCContext Ctx(TheTriple, MAI.get(), MRI.get(), &MOFI, STI.get(), nullptr);
|
|
|
a6a04d |
+ MOFI.initMCObjectFileInfo(Ctx, false, false);
|
|
|
a6a04d |
+#else
|
|
|
a6a04d |
MCContext Ctx(MAI.get(), MRI.get(), &MOFI, nullptr);
|
|
|
a6a04d |
MOFI.InitMCObjectFileInfo(TheTriple, false, Ctx, false);
|
|
|
a6a04d |
- std::unique_ptr<MCSubtargetInfo> STI(
|
|
|
a6a04d |
- T->createMCSubtargetInfo(TripleStr, "", ""));
|
|
|
a6a04d |
+#endif
|
|
|
a6a04d |
|
|
|
a6a04d |
std::unique_ptr<MCInstrInfo> MCII(T->createMCInstrInfo());
|
|
|
a6a04d |
MCInstPrinter *IP = T->createMCInstPrinter(TheTriple, 0, *MAI, *MCII, *MRI);
|
|
|
a6a04d |
--
|
|
|
a6a04d |
2.31.1
|
|
|
a6a04d |
|