aco: fix disassembly with LLVM 11
authorRhys Perry <pendingchaos02@gmail.com>
Fri, 15 May 2020 20:31:35 +0000 (21:31 +0100)
committerRhys Perry <pendingchaos02@gmail.com>
Tue, 19 May 2020 13:18:26 +0000 (14:18 +0100)
SymbolInfoTy was modified in LLVM 11. It is also in MCDisassembler.h now
and we don't have to duplicate it anymore.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5060>

src/amd/compiler/aco_print_asm.cpp

index 1c152e5b73eacf0301e5cf02321f119bc80474f1..0c69b8c7de36f24316807b8ff0273501fd2eb057 100644 (file)
@@ -5,6 +5,9 @@
 #include "ac_llvm_util.h"
 
 #include <llvm/ADT/StringRef.h>
+#if LLVM_VERSION_MAJOR >= 11
+#include <llvm/MC/MCDisassembler/MCDisassembler.h>
+#endif
 
 namespace aco {
 
@@ -92,7 +95,11 @@ void print_asm(Program *program, std::vector<uint32_t>& binary,
          referenced_blocks[succ] = true;
    }
 
+   #if LLVM_VERSION_MAJOR >= 11
+   std::vector<llvm::SymbolInfoTy> symbols;
+   #else
    std::vector<std::tuple<uint64_t, llvm::StringRef, uint8_t>> symbols;
+   #endif
    std::vector<std::array<char,16>> block_names;
    block_names.reserve(program->blocks.size());
    for (Block& block : program->blocks) {