By-pass some ArrayRef deduction guide
authorserge-sans-paille <sguelton@mozilla.com>
Thu, 5 Jan 2023 16:07:13 +0000 (17:07 +0100)
committerserge-sans-paille <sguelton@mozilla.com>
Thu, 5 Jan 2023 16:23:41 +0000 (17:23 +0100)
clang-11 doesn't fully support them and requires an explicit
instantiation in some situation. This is fixed in (at least) clang-14

llvm/tools/llvm-readobj/ELFDumper.cpp

index afd5b07..102fc1a 100644 (file)
@@ -6499,7 +6499,8 @@ template <class ELFT> void LLVMELFDumper<ELFT>::printFileHeaders() {
     DictScope D(W, "ElfHeader");
     {
       DictScope D(W, "Ident");
-      W.printBinary("Magic", ArrayRef(E.e_ident).slice(ELF::EI_MAG0, 4));
+      W.printBinary("Magic",
+                    ArrayRef<unsigned char>(E.e_ident).slice(ELF::EI_MAG0, 4));
       W.printEnum("Class", E.e_ident[ELF::EI_CLASS], ArrayRef(ElfClass));
       W.printEnum("DataEncoding", E.e_ident[ELF::EI_DATA],
                   ArrayRef(ElfDataEncoding));
@@ -6522,7 +6523,8 @@ template <class ELFT> void LLVMELFDumper<ELFT>::printFileHeaders() {
       }
       W.printEnum("OS/ABI", E.e_ident[ELF::EI_OSABI], OSABI);
       W.printNumber("ABIVersion", E.e_ident[ELF::EI_ABIVERSION]);
-      W.printBinary("Unused", ArrayRef(E.e_ident).slice(ELF::EI_PAD));
+      W.printBinary("Unused",
+                    ArrayRef<unsigned char>(E.e_ident).slice(ELF::EI_PAD));
     }
 
     std::string TypeStr;