Update prebuilt Clang to match Android kernel.
Bug: 132428451
Change-Id: I8f6e2cb23f381fc0c02ddea99b867e58e925e5be
diff --git a/linux-x64/clang/include/llvm/BinaryFormat/AMDGPUMetadataVerifier.h b/linux-x64/clang/include/llvm/BinaryFormat/AMDGPUMetadataVerifier.h
new file mode 100644
index 0000000..522721a
--- /dev/null
+++ b/linux-x64/clang/include/llvm/BinaryFormat/AMDGPUMetadataVerifier.h
@@ -0,0 +1,69 @@
+//===- AMDGPUMetadataVerifier.h - MsgPack Types -----------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+/// \file
+/// This is a verifier for AMDGPU HSA metadata, which can verify both
+/// well-typed metadata and untyped metadata. When verifying in the non-strict
+/// mode, untyped metadata is coerced into the correct type if possible.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_BINARYFORMAT_AMDGPUMETADATAVERIFIER_H
+#define LLVM_BINARYFORMAT_AMDGPUMETADATAVERIFIER_H
+
+#include "llvm/BinaryFormat/MsgPackTypes.h"
+
+namespace llvm {
+namespace AMDGPU {
+namespace HSAMD {
+namespace V3 {
+
+/// Verifier for AMDGPU HSA metadata.
+///
+/// Operates in two modes:
+///
+/// In strict mode, metadata must already be well-typed.
+///
+/// In non-strict mode, metadata is coerced into expected types when possible.
+class MetadataVerifier {
+ bool Strict;
+
+ bool verifyScalar(msgpack::Node &Node, msgpack::ScalarNode::ScalarKind SKind,
+ function_ref<bool(msgpack::ScalarNode &)> verifyValue = {});
+ bool verifyInteger(msgpack::Node &Node);
+ bool verifyArray(msgpack::Node &Node,
+ function_ref<bool(msgpack::Node &)> verifyNode,
+ Optional<size_t> Size = None);
+ bool verifyEntry(msgpack::MapNode &MapNode, StringRef Key, bool Required,
+ function_ref<bool(msgpack::Node &)> verifyNode);
+ bool
+ verifyScalarEntry(msgpack::MapNode &MapNode, StringRef Key, bool Required,
+ msgpack::ScalarNode::ScalarKind SKind,
+ function_ref<bool(msgpack::ScalarNode &)> verifyValue = {});
+ bool verifyIntegerEntry(msgpack::MapNode &MapNode, StringRef Key,
+ bool Required);
+ bool verifyKernelArgs(msgpack::Node &Node);
+ bool verifyKernel(msgpack::Node &Node);
+
+public:
+ /// Construct a MetadataVerifier, specifying whether it will operate in \p
+ /// Strict mode.
+ MetadataVerifier(bool Strict) : Strict(Strict) {}
+
+ /// Verify given HSA metadata.
+ ///
+ /// \returns True when successful, false when metadata is invalid.
+ bool verify(msgpack::Node &HSAMetadataRoot);
+};
+
+} // end namespace V3
+} // end namespace HSAMD
+} // end namespace AMDGPU
+} // end namespace llvm
+
+#endif // LLVM_BINARYFORMAT_AMDGPUMETADATAVERIFIER_H
diff --git a/linux-x64/clang/include/llvm/BinaryFormat/COFF.h b/linux-x64/clang/include/llvm/BinaryFormat/COFF.h
index 7b973c0..e0543de 100644
--- a/linux-x64/clang/include/llvm/BinaryFormat/COFF.h
+++ b/linux-x64/clang/include/llvm/BinaryFormat/COFF.h
@@ -1,9 +1,8 @@
//===-- llvm/BinaryFormat/COFF.h --------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -371,13 +370,15 @@
IMAGE_REL_ARM_TOKEN = 0x0005,
IMAGE_REL_ARM_BLX24 = 0x0008,
IMAGE_REL_ARM_BLX11 = 0x0009,
+ IMAGE_REL_ARM_REL32 = 0x000A,
IMAGE_REL_ARM_SECTION = 0x000E,
IMAGE_REL_ARM_SECREL = 0x000F,
IMAGE_REL_ARM_MOV32A = 0x0010,
IMAGE_REL_ARM_MOV32T = 0x0011,
IMAGE_REL_ARM_BRANCH20T = 0x0012,
IMAGE_REL_ARM_BRANCH24T = 0x0014,
- IMAGE_REL_ARM_BLX23T = 0x0015
+ IMAGE_REL_ARM_BLX23T = 0x0015,
+ IMAGE_REL_ARM_PAIR = 0x0016,
};
enum RelocationTypesARM64 : unsigned {
@@ -398,6 +399,7 @@
IMAGE_REL_ARM64_ADDR64 = 0x000E,
IMAGE_REL_ARM64_BRANCH19 = 0x000F,
IMAGE_REL_ARM64_BRANCH14 = 0x0010,
+ IMAGE_REL_ARM64_REL32 = 0x0011,
};
enum COMDATType : unsigned {
diff --git a/linux-x64/clang/include/llvm/BinaryFormat/Dwarf.def b/linux-x64/clang/include/llvm/BinaryFormat/Dwarf.def
index 6b7a741..90ae023 100644
--- a/linux-x64/clang/include/llvm/BinaryFormat/Dwarf.def
+++ b/linux-x64/clang/include/llvm/BinaryFormat/Dwarf.def
@@ -1,9 +1,8 @@
//===- llvm/Support/Dwarf.def - Dwarf definitions ---------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -18,7 +17,8 @@
defined HANDLE_DW_VIRTUALITY || defined HANDLE_DW_DEFAULTED || \
defined HANDLE_DW_CC || defined HANDLE_DW_LNS || defined HANDLE_DW_LNE || \
defined HANDLE_DW_LNCT || defined HANDLE_DW_MACRO || \
- defined HANDLE_DW_RLE || defined HANDLE_DW_CFA || \
+ defined HANDLE_DW_RLE || \
+ (defined HANDLE_DW_CFA && defined HANDLE_DW_CFA_PRED) || \
defined HANDLE_DW_APPLE_PROPERTY || defined HANDLE_DW_UT || \
defined HANDLE_DWARF_SECTION || defined HANDLE_DW_IDX || \
defined HANDLE_DW_END)
@@ -42,7 +42,7 @@
#endif
#ifndef HANDLE_DW_LANG
-#define HANDLE_DW_LANG(ID, NAME, VERSION, VENDOR)
+#define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR)
#endif
#ifndef HANDLE_DW_ATE
@@ -85,6 +85,10 @@
#define HANDLE_DW_CFA(ID, NAME)
#endif
+#ifndef HANDLE_DW_CFA_PRED
+#define HANDLE_DW_CFA_PRED(ID, NAME, PRED)
+#endif
+
#ifndef HANDLE_DW_APPLE_PROPERTY
#define HANDLE_DW_APPLE_PROPERTY(ID, NAME)
#endif
@@ -627,50 +631,50 @@
HANDLE_DW_OP(0xfc, GNU_const_index, 0, GNU)
// DWARF languages.
-HANDLE_DW_LANG(0x0001, C89, 2, DWARF)
-HANDLE_DW_LANG(0x0002, C, 2, DWARF)
-HANDLE_DW_LANG(0x0003, Ada83, 2, DWARF)
-HANDLE_DW_LANG(0x0004, C_plus_plus, 2, DWARF)
-HANDLE_DW_LANG(0x0005, Cobol74, 2, DWARF)
-HANDLE_DW_LANG(0x0006, Cobol85, 2, DWARF)
-HANDLE_DW_LANG(0x0007, Fortran77, 2, DWARF)
-HANDLE_DW_LANG(0x0008, Fortran90, 2, DWARF)
-HANDLE_DW_LANG(0x0009, Pascal83, 2, DWARF)
-HANDLE_DW_LANG(0x000a, Modula2, 2, DWARF)
+HANDLE_DW_LANG(0x0001, C89, 0, 2, DWARF)
+HANDLE_DW_LANG(0x0002, C, 0, 2, DWARF)
+HANDLE_DW_LANG(0x0003, Ada83, 1, 2, DWARF)
+HANDLE_DW_LANG(0x0004, C_plus_plus, 0, 2, DWARF)
+HANDLE_DW_LANG(0x0005, Cobol74, 1, 2, DWARF)
+HANDLE_DW_LANG(0x0006, Cobol85, 1, 2, DWARF)
+HANDLE_DW_LANG(0x0007, Fortran77, 1, 2, DWARF)
+HANDLE_DW_LANG(0x0008, Fortran90, 1, 2, DWARF)
+HANDLE_DW_LANG(0x0009, Pascal83, 1, 2, DWARF)
+HANDLE_DW_LANG(0x000a, Modula2, 1, 2, DWARF)
// New in DWARF v3:
-HANDLE_DW_LANG(0x000b, Java, 3, DWARF)
-HANDLE_DW_LANG(0x000c, C99, 3, DWARF)
-HANDLE_DW_LANG(0x000d, Ada95, 3, DWARF)
-HANDLE_DW_LANG(0x000e, Fortran95, 3, DWARF)
-HANDLE_DW_LANG(0x000f, PLI, 3, DWARF)
-HANDLE_DW_LANG(0x0010, ObjC, 3, DWARF)
-HANDLE_DW_LANG(0x0011, ObjC_plus_plus, 3, DWARF)
-HANDLE_DW_LANG(0x0012, UPC, 3, DWARF)
-HANDLE_DW_LANG(0x0013, D, 3, DWARF)
+HANDLE_DW_LANG(0x000b, Java, 0, 3, DWARF)
+HANDLE_DW_LANG(0x000c, C99, 0, 3, DWARF)
+HANDLE_DW_LANG(0x000d, Ada95, 1, 3, DWARF)
+HANDLE_DW_LANG(0x000e, Fortran95, 1, 3, DWARF)
+HANDLE_DW_LANG(0x000f, PLI, 1, 3, DWARF)
+HANDLE_DW_LANG(0x0010, ObjC, 0, 3, DWARF)
+HANDLE_DW_LANG(0x0011, ObjC_plus_plus, 0, 3, DWARF)
+HANDLE_DW_LANG(0x0012, UPC, 0, 3, DWARF)
+HANDLE_DW_LANG(0x0013, D, 0, 3, DWARF)
// New in DWARF v4:
-HANDLE_DW_LANG(0x0014, Python, 4, DWARF)
+HANDLE_DW_LANG(0x0014, Python, 0, 4, DWARF)
// New in DWARF v5:
-HANDLE_DW_LANG(0x0015, OpenCL, 5, DWARF)
-HANDLE_DW_LANG(0x0016, Go, 5, DWARF)
-HANDLE_DW_LANG(0x0017, Modula3, 5, DWARF)
-HANDLE_DW_LANG(0x0018, Haskell, 5, DWARF)
-HANDLE_DW_LANG(0x0019, C_plus_plus_03, 5, DWARF)
-HANDLE_DW_LANG(0x001a, C_plus_plus_11, 5, DWARF)
-HANDLE_DW_LANG(0x001b, OCaml, 5, DWARF)
-HANDLE_DW_LANG(0x001c, Rust, 5, DWARF)
-HANDLE_DW_LANG(0x001d, C11, 5, DWARF)
-HANDLE_DW_LANG(0x001e, Swift, 5, DWARF)
-HANDLE_DW_LANG(0x001f, Julia, 5, DWARF)
-HANDLE_DW_LANG(0x0020, Dylan, 5, DWARF)
-HANDLE_DW_LANG(0x0021, C_plus_plus_14, 5, DWARF)
-HANDLE_DW_LANG(0x0022, Fortran03, 5, DWARF)
-HANDLE_DW_LANG(0x0023, Fortran08, 5, DWARF)
-HANDLE_DW_LANG(0x0024, RenderScript, 5, DWARF)
-HANDLE_DW_LANG(0x0025, BLISS, 5, DWARF)
+HANDLE_DW_LANG(0x0015, OpenCL, 0, 5, DWARF)
+HANDLE_DW_LANG(0x0016, Go, 0, 5, DWARF)
+HANDLE_DW_LANG(0x0017, Modula3, 1, 5, DWARF)
+HANDLE_DW_LANG(0x0018, Haskell, 0, 5, DWARF)
+HANDLE_DW_LANG(0x0019, C_plus_plus_03, 0, 5, DWARF)
+HANDLE_DW_LANG(0x001a, C_plus_plus_11, 0, 5, DWARF)
+HANDLE_DW_LANG(0x001b, OCaml, 0, 5, DWARF)
+HANDLE_DW_LANG(0x001c, Rust, 0, 5, DWARF)
+HANDLE_DW_LANG(0x001d, C11, 0, 5, DWARF)
+HANDLE_DW_LANG(0x001e, Swift, 0, 5, DWARF)
+HANDLE_DW_LANG(0x001f, Julia, 1, 5, DWARF)
+HANDLE_DW_LANG(0x0020, Dylan, 0, 5, DWARF)
+HANDLE_DW_LANG(0x0021, C_plus_plus_14, 0, 5, DWARF)
+HANDLE_DW_LANG(0x0022, Fortran03, 1, 5, DWARF)
+HANDLE_DW_LANG(0x0023, Fortran08, 1, 5, DWARF)
+HANDLE_DW_LANG(0x0024, RenderScript, 0, 5, DWARF)
+HANDLE_DW_LANG(0x0025, BLISS, 0, 5, DWARF)
// Vendor extensions:
-HANDLE_DW_LANG(0x8001, Mips_Assembler, 0, MIPS)
-HANDLE_DW_LANG(0x8e57, GOOGLE_RenderScript, 0, GOOGLE)
-HANDLE_DW_LANG(0xb000, BORLAND_Delphi, 0, BORLAND)
+HANDLE_DW_LANG(0x8001, Mips_Assembler, None, 0, MIPS)
+HANDLE_DW_LANG(0x8e57, GOOGLE_RenderScript, 0, 0, GOOGLE)
+HANDLE_DW_LANG(0xb000, BORLAND_Delphi, 0, 0, BORLAND)
// DWARF attribute type encodings.
HANDLE_DW_ATE(0x01, address, 2, DWARF)
@@ -831,9 +835,10 @@
HANDLE_DW_CFA(0x15, val_offset_sf)
HANDLE_DW_CFA(0x16, val_expression)
// Vendor extensions:
-HANDLE_DW_CFA(0x1d, MIPS_advance_loc8)
-HANDLE_DW_CFA(0x2d, GNU_window_save)
-HANDLE_DW_CFA(0x2e, GNU_args_size)
+HANDLE_DW_CFA_PRED(0x1d, MIPS_advance_loc8, SELECT_MIPS64)
+HANDLE_DW_CFA_PRED(0x2d, GNU_window_save, SELECT_SPARC)
+HANDLE_DW_CFA_PRED(0x2d, AARCH64_negate_ra_state, SELECT_AARCH64)
+HANDLE_DW_CFA_PRED(0x2e, GNU_args_size, SELECT_X86)
// Apple Objective-C Property Attributes.
// Keep this list in sync with clang's DeclSpec.h ObjCPropertyAttributeKind!
@@ -873,6 +878,7 @@
HANDLE_DWARF_SECTION(DebugLine, ".debug_line", "debug-line")
HANDLE_DWARF_SECTION(DebugLineStr, ".debug_line_str", "debug-line-str")
HANDLE_DWARF_SECTION(DebugLoc, ".debug_loc", "debug-loc")
+HANDLE_DWARF_SECTION(DebugLoclists, ".debug_loclists", "debug-loclists")
HANDLE_DWARF_SECTION(DebugFrame, ".debug_frame", "debug-frame")
HANDLE_DWARF_SECTION(DebugMacro, ".debug_macro", "debug-macro")
HANDLE_DWARF_SECTION(DebugNames, ".debug_names", "debug-names")
@@ -915,6 +921,7 @@
#undef HANDLE_DW_MACRO
#undef HANDLE_DW_RLE
#undef HANDLE_DW_CFA
+#undef HANDLE_DW_CFA_PRED
#undef HANDLE_DW_APPLE_PROPERTY
#undef HANDLE_DW_UT
#undef HANDLE_DWARF_SECTION
diff --git a/linux-x64/clang/include/llvm/BinaryFormat/Dwarf.h b/linux-x64/clang/include/llvm/BinaryFormat/Dwarf.h
index 330e31c..3757c75 100644
--- a/linux-x64/clang/include/llvm/BinaryFormat/Dwarf.h
+++ b/linux-x64/clang/include/llvm/BinaryFormat/Dwarf.h
@@ -1,9 +1,8 @@
//===-- llvm/BinaryFormat/Dwarf.h ---Dwarf Constants-------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -26,6 +25,7 @@
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/FormatVariadicDetails.h"
+#include "llvm/ADT/Triple.h"
namespace llvm {
class StringRef;
@@ -183,7 +183,8 @@
};
enum SourceLanguage {
-#define HANDLE_DW_LANG(ID, NAME, VERSION, VENDOR) DW_LANG_##NAME = ID,
+#define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
+ DW_LANG_##NAME = ID,
#include "llvm/BinaryFormat/Dwarf.def"
DW_LANG_lo_user = 0x8000,
DW_LANG_hi_user = 0xffff
@@ -272,6 +273,7 @@
/// Call frame instruction encodings.
enum CallFrameInfo {
#define HANDLE_DW_CFA(ID, NAME) DW_CFA_##NAME = ID,
+#define HANDLE_DW_CFA_PRED(ID, NAME, ARCH) DW_CFA_##NAME = ID,
#include "llvm/BinaryFormat/Dwarf.def"
DW_CFA_extended = 0x00,
@@ -430,7 +432,7 @@
StringRef LNExtendedString(unsigned Encoding);
StringRef MacinfoString(unsigned Encoding);
StringRef RangeListEncodingString(unsigned Encoding);
-StringRef CallFrameString(unsigned Encoding);
+StringRef CallFrameString(unsigned Encoding, Triple::ArchType Arch);
StringRef ApplePropertyString(unsigned);
StringRef UnitTypeString(unsigned);
StringRef AtomTypeString(unsigned Atom);
@@ -488,6 +490,8 @@
unsigned LanguageVendor(SourceLanguage L);
/// @}
+Optional<unsigned> LanguageLowerBound(SourceLanguage L);
+
/// A helper struct providing information about the byte size of DW_FORM
/// values that vary in size depending on the DWARF version, address byte
/// size, or DWARF32/DWARF64.
diff --git a/linux-x64/clang/include/llvm/BinaryFormat/ELF.h b/linux-x64/clang/include/llvm/BinaryFormat/ELF.h
index 2e77877..8e3860c 100644
--- a/linux-x64/clang/include/llvm/BinaryFormat/ELF.h
+++ b/linux-x64/clang/include/llvm/BinaryFormat/ELF.h
@@ -1,9 +1,8 @@
//===- llvm/BinaryFormat/ELF.h - ELF constants and structures ---*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -582,6 +581,7 @@
EF_HEXAGON_MACH_V60 = 0x00000060, // Hexagon V60
EF_HEXAGON_MACH_V62 = 0x00000062, // Hexagon V62
EF_HEXAGON_MACH_V65 = 0x00000065, // Hexagon V65
+ EF_HEXAGON_MACH_V66 = 0x00000066, // Hexagon V66
// Highest ISA version flags
EF_HEXAGON_ISA_MACH = 0x00000000, // Same as specified in bits[11:0]
@@ -594,6 +594,7 @@
EF_HEXAGON_ISA_V60 = 0x00000060, // Hexagon V60 ISA
EF_HEXAGON_ISA_V62 = 0x00000062, // Hexagon V62 ISA
EF_HEXAGON_ISA_V65 = 0x00000065, // Hexagon V65 ISA
+ EF_HEXAGON_ISA_V66 = 0x00000066, // Hexagon V66 ISA
};
// Hexagon-specific section indexes for common small data
@@ -701,6 +702,7 @@
EF_AMDGPU_MACH_AMDGCN_GFX902 = 0x02d,
EF_AMDGPU_MACH_AMDGCN_GFX904 = 0x02e,
EF_AMDGPU_MACH_AMDGCN_GFX906 = 0x02f,
+ EF_AMDGPU_MACH_AMDGCN_GFX909 = 0x031,
// Reserved for AMDGCN-based processors.
EF_AMDGPU_MACH_AMDGCN_RESERVED0 = 0x027,
@@ -708,11 +710,14 @@
// First/last AMDGCN-based processors.
EF_AMDGPU_MACH_AMDGCN_FIRST = EF_AMDGPU_MACH_AMDGCN_GFX600,
- EF_AMDGPU_MACH_AMDGCN_LAST = EF_AMDGPU_MACH_AMDGCN_GFX906,
+ EF_AMDGPU_MACH_AMDGCN_LAST = EF_AMDGPU_MACH_AMDGCN_GFX909,
- // Indicates if the xnack target feature is enabled for all code contained in
- // the object.
+ // Indicates if the "xnack" target feature is enabled for all code contained
+ // in the object.
EF_AMDGPU_XNACK = 0x100,
+ // Indicates if the "sram-ecc" target feature is enabled for all code
+ // contained in the object.
+ EF_AMDGPU_SRAM_ECC = 0x200,
};
// ELF Relocation types for AMDGPU
@@ -725,6 +730,38 @@
#include "ELFRelocs/BPF.def"
};
+// MSP430 specific e_flags
+enum : unsigned {
+ EF_MSP430_MACH_MSP430x11 = 11,
+ EF_MSP430_MACH_MSP430x11x1 = 110,
+ EF_MSP430_MACH_MSP430x12 = 12,
+ EF_MSP430_MACH_MSP430x13 = 13,
+ EF_MSP430_MACH_MSP430x14 = 14,
+ EF_MSP430_MACH_MSP430x15 = 15,
+ EF_MSP430_MACH_MSP430x16 = 16,
+ EF_MSP430_MACH_MSP430x20 = 20,
+ EF_MSP430_MACH_MSP430x22 = 22,
+ EF_MSP430_MACH_MSP430x23 = 23,
+ EF_MSP430_MACH_MSP430x24 = 24,
+ EF_MSP430_MACH_MSP430x26 = 26,
+ EF_MSP430_MACH_MSP430x31 = 31,
+ EF_MSP430_MACH_MSP430x32 = 32,
+ EF_MSP430_MACH_MSP430x33 = 33,
+ EF_MSP430_MACH_MSP430x41 = 41,
+ EF_MSP430_MACH_MSP430x42 = 42,
+ EF_MSP430_MACH_MSP430x43 = 43,
+ EF_MSP430_MACH_MSP430x44 = 44,
+ EF_MSP430_MACH_MSP430X = 45,
+ EF_MSP430_MACH_MSP430x46 = 46,
+ EF_MSP430_MACH_MSP430x47 = 47,
+ EF_MSP430_MACH_MSP430x54 = 54,
+};
+
+// ELF Relocation types for MSP430
+enum {
+#include "ELFRelocs/MSP430.def"
+};
+
#undef ELF_RELOC
// Section header.
@@ -829,6 +866,8 @@
SHT_MIPS_DWARF = 0x7000001e, // DWARF debugging section.
SHT_MIPS_ABIFLAGS = 0x7000002a, // ABI information.
+ SHT_MSP430_ATTRIBUTES = 0x70000003U,
+
SHT_HIPROC = 0x7fffffff, // Highest processor arch-specific type.
SHT_LOUSER = 0x80000000, // Lowest type reserved for applications.
SHT_HIUSER = 0xffffffff // Highest type reserved for applications.
@@ -1312,16 +1351,29 @@
enum : unsigned {
GNU_PROPERTY_STACK_SIZE = 1,
GNU_PROPERTY_NO_COPY_ON_PROTECTED = 2,
- GNU_PROPERTY_X86_FEATURE_1_AND = 0xc0000002
+ GNU_PROPERTY_X86_FEATURE_1_AND = 0xc0000002,
+ GNU_PROPERTY_X86_FEATURE_2_NEEDED = 0xc0008001,
+ GNU_PROPERTY_X86_FEATURE_2_USED = 0xc0010001,
};
-// CET properties
-enum {
+// x86 processor feature bits.
+enum : unsigned {
GNU_PROPERTY_X86_FEATURE_1_IBT = 1 << 0,
- GNU_PROPERTY_X86_FEATURE_1_SHSTK = 1 << 1
+ GNU_PROPERTY_X86_FEATURE_1_SHSTK = 1 << 1,
+
+ GNU_PROPERTY_X86_FEATURE_2_X86 = 1 << 0,
+ GNU_PROPERTY_X86_FEATURE_2_X87 = 1 << 1,
+ GNU_PROPERTY_X86_FEATURE_2_MMX = 1 << 2,
+ GNU_PROPERTY_X86_FEATURE_2_XMM = 1 << 3,
+ GNU_PROPERTY_X86_FEATURE_2_YMM = 1 << 4,
+ GNU_PROPERTY_X86_FEATURE_2_ZMM = 1 << 5,
+ GNU_PROPERTY_X86_FEATURE_2_FXSR = 1 << 6,
+ GNU_PROPERTY_X86_FEATURE_2_XSAVE = 1 << 7,
+ GNU_PROPERTY_X86_FEATURE_2_XSAVEOPT = 1 << 8,
+ GNU_PROPERTY_X86_FEATURE_2_XSAVEC = 1 << 9,
};
-// AMDGPU specific notes.
+// AMD specific notes. (Code Object V2)
enum {
// Note types with values between 0 and 9 (inclusive) are reserved.
NT_AMD_AMDGPU_HSA_METADATA = 10,
@@ -1329,6 +1381,12 @@
NT_AMD_AMDGPU_PAL_METADATA = 12
};
+// AMDGPU specific notes. (Code Object V3)
+enum {
+ // Note types with values between 0 and 31 (inclusive) are reserved.
+ NT_AMDGPU_METADATA = 32
+};
+
enum {
GNU_ABI_TAG_LINUX = 0,
GNU_ABI_TAG_HURD = 1,
@@ -1339,6 +1397,8 @@
GNU_ABI_TAG_NACL = 6,
};
+constexpr const char *ELF_NOTE_GNU = "GNU";
+
// Android packed relocation group flags.
enum {
RELOCATION_GROUPED_BY_INFO_FLAG = 1,
diff --git a/linux-x64/clang/include/llvm/BinaryFormat/ELFRelocs/MSP430.def b/linux-x64/clang/include/llvm/BinaryFormat/ELFRelocs/MSP430.def
new file mode 100644
index 0000000..96990ab
--- /dev/null
+++ b/linux-x64/clang/include/llvm/BinaryFormat/ELFRelocs/MSP430.def
@@ -0,0 +1,16 @@
+
+#ifndef ELF_RELOC
+#error "ELF_RELOC must be defined"
+#endif
+
+ELF_RELOC(R_MSP430_NONE, 0)
+ELF_RELOC(R_MSP430_32, 1)
+ELF_RELOC(R_MSP430_10_PCREL, 2)
+ELF_RELOC(R_MSP430_16, 3)
+ELF_RELOC(R_MSP430_16_PCREL, 4)
+ELF_RELOC(R_MSP430_16_BYTE, 5)
+ELF_RELOC(R_MSP430_16_PCREL_BYTE, 6)
+ELF_RELOC(R_MSP430_2X_PCREL, 7)
+ELF_RELOC(R_MSP430_RL_PCREL, 8)
+ELF_RELOC(R_MSP430_8, 9)
+ELF_RELOC(R_MSP430_SYM_DIFF, 10)
diff --git a/linux-x64/clang/include/llvm/BinaryFormat/MachO.def b/linux-x64/clang/include/llvm/BinaryFormat/MachO.def
index 95de48d..76dcc58 100644
--- a/linux-x64/clang/include/llvm/BinaryFormat/MachO.def
+++ b/linux-x64/clang/include/llvm/BinaryFormat/MachO.def
@@ -1,9 +1,8 @@
//,,,-- llvm/Support/MachO.def - The MachO file definitions -----*- C++ -*-,,,//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//,,,----------------------------------------------------------------------,,,//
//
diff --git a/linux-x64/clang/include/llvm/BinaryFormat/MachO.h b/linux-x64/clang/include/llvm/BinaryFormat/MachO.h
index c5294c7..08fe780 100644
--- a/linux-x64/clang/include/llvm/BinaryFormat/MachO.h
+++ b/linux-x64/clang/include/llvm/BinaryFormat/MachO.h
@@ -1,9 +1,8 @@
//===-- llvm/BinaryFormat/MachO.h - The MachO file format -------*- C++/-*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -335,6 +334,7 @@
N_WEAK_DEF = 0x0080u,
N_SYMBOL_RESOLVER = 0x0100u,
N_ALT_ENTRY = 0x0200u,
+ N_COLD_FUNC = 0x0400u,
// For undefined symbols coming from libraries, see GET_LIBRARY_ORDINAL()
// as these are in the top 8 bits.
SELF_LIBRARY_ORDINAL = 0x0,
@@ -486,7 +486,10 @@
PLATFORM_IOS = 2,
PLATFORM_TVOS = 3,
PLATFORM_WATCHOS = 4,
- PLATFORM_BRIDGEOS = 5
+ PLATFORM_BRIDGEOS = 5,
+ PLATFORM_IOSSIMULATOR = 7,
+ PLATFORM_TVOSSIMULATOR = 8,
+ PLATFORM_WATCHOSSIMULATOR = 9
};
// Values for tools enum in build_tool_version.
diff --git a/linux-x64/clang/include/llvm/BinaryFormat/Magic.h b/linux-x64/clang/include/llvm/BinaryFormat/Magic.h
index 04801f8..05af2c3 100644
--- a/linux-x64/clang/include/llvm/BinaryFormat/Magic.h
+++ b/linux-x64/clang/include/llvm/BinaryFormat/Magic.h
@@ -1,9 +1,8 @@
//===- llvm/BinaryFormat/Magic.h - File magic identification ----*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/linux-x64/clang/include/llvm/BinaryFormat/MsgPack.def b/linux-x64/clang/include/llvm/BinaryFormat/MsgPack.def
index 781b49f..7ad83ff 100644
--- a/linux-x64/clang/include/llvm/BinaryFormat/MsgPack.def
+++ b/linux-x64/clang/include/llvm/BinaryFormat/MsgPack.def
@@ -1,9 +1,8 @@
//===- MsgPack.def - MessagePack definitions --------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
diff --git a/linux-x64/clang/include/llvm/BinaryFormat/MsgPack.h b/linux-x64/clang/include/llvm/BinaryFormat/MsgPack.h
index d431912..9fda14b 100644
--- a/linux-x64/clang/include/llvm/BinaryFormat/MsgPack.h
+++ b/linux-x64/clang/include/llvm/BinaryFormat/MsgPack.h
@@ -1,9 +1,8 @@
//===-- MsgPack.h - MessagePack Constants -----------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
diff --git a/linux-x64/clang/include/llvm/BinaryFormat/MsgPackReader.h b/linux-x64/clang/include/llvm/BinaryFormat/MsgPackReader.h
index 511c314..2d332f5 100644
--- a/linux-x64/clang/include/llvm/BinaryFormat/MsgPackReader.h
+++ b/linux-x64/clang/include/llvm/BinaryFormat/MsgPackReader.h
@@ -1,9 +1,8 @@
//===- MsgPackReader.h - Simple MsgPack reader ------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
diff --git a/linux-x64/clang/include/llvm/BinaryFormat/MsgPackTypes.h b/linux-x64/clang/include/llvm/BinaryFormat/MsgPackTypes.h
new file mode 100644
index 0000000..fcb11ab
--- /dev/null
+++ b/linux-x64/clang/include/llvm/BinaryFormat/MsgPackTypes.h
@@ -0,0 +1,371 @@
+//===- MsgPackTypes.h - MsgPack Types ---------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+/// \file
+/// This is a data structure for representing MessagePack "documents", with
+/// methods to go to and from MessagePack. The types also specialize YAMLIO
+/// traits in order to go to and from YAML.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/ADT/Optional.h"
+#include "llvm/BinaryFormat/MsgPackReader.h"
+#include "llvm/BinaryFormat/MsgPackWriter.h"
+#include "llvm/Support/Casting.h"
+#include "llvm/Support/YAMLTraits.h"
+#include <vector>
+
+#ifndef LLVM_BINARYFORMAT_MSGPACKTYPES_H
+#define LLVM_BINARYFORMAT_MSGPACKTYPES_H
+
+namespace llvm {
+namespace msgpack {
+
+class Node;
+
+/// Short-hand for a Node pointer.
+using NodePtr = std::shared_ptr<Node>;
+
+/// Short-hand for an Optional Node pointer.
+using OptNodePtr = Optional<NodePtr>;
+
+/// Abstract base-class which can be any MessagePack type.
+class Node {
+public:
+ enum NodeKind {
+ NK_Scalar,
+ NK_Array,
+ NK_Map,
+ };
+
+private:
+ virtual void anchor() = 0;
+ const NodeKind Kind;
+
+ static Expected<OptNodePtr> readArray(Reader &MPReader, size_t Length);
+ static Expected<OptNodePtr> readMap(Reader &MPReader, size_t Length);
+
+public:
+ NodeKind getKind() const { return Kind; }
+
+ /// Construct a Node. Used by derived classes to track kind information.
+ Node(NodeKind Kind) : Kind(Kind) {}
+
+ virtual ~Node() = default;
+
+ /// Read from a MessagePack reader \p MPReader, returning an error if one is
+ /// encountered, or None if \p MPReader is at the end of stream, or some Node
+ /// pointer if some type is read.
+ static Expected<OptNodePtr> read(Reader &MPReader);
+
+ /// Write to a MessagePack writer \p MPWriter.
+ virtual void write(Writer &MPWriter) = 0;
+};
+
+/// A MessagePack scalar.
+class ScalarNode : public Node {
+public:
+ enum ScalarKind {
+ SK_Int,
+ SK_UInt,
+ SK_Nil,
+ SK_Boolean,
+ SK_Float,
+ SK_String,
+ SK_Binary,
+ };
+
+private:
+ void anchor() override;
+
+ void destroy();
+
+ ScalarKind SKind;
+
+ union {
+ int64_t IntValue;
+ uint64_t UIntValue;
+ bool BoolValue;
+ double FloatValue;
+ std::string StringValue;
+ };
+
+public:
+ /// Construct an Int ScalarNode.
+ ScalarNode(int64_t IntValue);
+ /// Construct an Int ScalarNode.
+ ScalarNode(int32_t IntValue);
+ /// Construct an UInt ScalarNode.
+ ScalarNode(uint64_t UIntValue);
+ /// Construct an UInt ScalarNode.
+ ScalarNode(uint32_t UIntValue);
+ /// Construct a Nil ScalarNode.
+ ScalarNode();
+ /// Construct a Boolean ScalarNode.
+ ScalarNode(bool BoolValue);
+ /// Construct a Float ScalarNode.
+ ScalarNode(double FloatValue);
+ /// Construct a String ScalarNode.
+ ScalarNode(StringRef StringValue);
+ /// Construct a String ScalarNode.
+ ScalarNode(const char *StringValue);
+ /// Construct a String ScalarNode.
+ ScalarNode(std::string &&StringValue);
+ /// Construct a Binary ScalarNode.
+ ScalarNode(MemoryBufferRef BinaryValue);
+
+ ~ScalarNode();
+
+ ScalarNode &operator=(const ScalarNode &RHS) = delete;
+ /// A ScalarNode can only be move assigned.
+ ScalarNode &operator=(ScalarNode &&RHS);
+
+ /// Change the kind of this ScalarNode, zero initializing it to the new type.
+ void setScalarKind(ScalarKind SKind) {
+ switch (SKind) {
+ case SK_Int:
+ *this = int64_t(0);
+ break;
+ case SK_UInt:
+ *this = uint64_t(0);
+ break;
+ case SK_Boolean:
+ *this = false;
+ break;
+ case SK_Float:
+ *this = 0.0;
+ break;
+ case SK_String:
+ *this = StringRef();
+ break;
+ case SK_Binary:
+ *this = MemoryBufferRef("", "");
+ break;
+ case SK_Nil:
+ *this = ScalarNode();
+ break;
+ }
+ }
+
+ /// Get the current kind of ScalarNode.
+ ScalarKind getScalarKind() { return SKind; }
+
+ /// Get the value of an Int scalar.
+ ///
+ /// \warning Assumes getScalarKind() == SK_Int
+ int64_t getInt() {
+ assert(SKind == SK_Int);
+ return IntValue;
+ }
+
+ /// Get the value of a UInt scalar.
+ ///
+ /// \warning Assumes getScalarKind() == SK_UInt
+ uint64_t getUInt() {
+ assert(SKind == SK_UInt);
+ return UIntValue;
+ }
+
+ /// Get the value of an Boolean scalar.
+ ///
+ /// \warning Assumes getScalarKind() == SK_Boolean
+ bool getBool() {
+ assert(SKind == SK_Boolean);
+ return BoolValue;
+ }
+
+ /// Get the value of an Float scalar.
+ ///
+ /// \warning Assumes getScalarKind() == SK_Float
+ double getFloat() {
+ assert(SKind == SK_Float);
+ return FloatValue;
+ }
+
+ /// Get the value of a String scalar.
+ ///
+ /// \warning Assumes getScalarKind() == SK_String
+ StringRef getString() {
+ assert(SKind == SK_String);
+ return StringValue;
+ }
+
+ /// Get the value of a Binary scalar.
+ ///
+ /// \warning Assumes getScalarKind() == SK_Binary
+ StringRef getBinary() {
+ assert(SKind == SK_Binary);
+ return StringValue;
+ }
+
+ static bool classof(const Node *N) { return N->getKind() == NK_Scalar; }
+
+ void write(Writer &MPWriter) override;
+
+ /// Parse a YAML scalar of the current ScalarKind from \p ScalarStr.
+ ///
+ /// \returns An empty string on success, otherwise an error message.
+ StringRef inputYAML(StringRef ScalarStr);
+
+ /// Output a YAML scalar of the current ScalarKind into \p OS.
+ void outputYAML(raw_ostream &OS) const;
+
+ /// Determine which YAML quoting type the current value would need when
+ /// output.
+ yaml::QuotingType mustQuoteYAML(StringRef ScalarStr) const;
+
+ /// Get the YAML tag for the current ScalarKind.
+ StringRef getYAMLTag() const;
+
+ /// Flag which affects how the type handles YAML tags when reading and
+ /// writing.
+ ///
+ /// When false, tags are used when reading and writing. When reading, the tag
+ /// is used to decide the ScalarKind before parsing. When writing, the tag is
+ /// output along with the value.
+ ///
+ /// When true, tags are ignored when reading and writing. When reading, the
+ /// ScalarKind is always assumed to be String. When writing, the tag is not
+ /// output.
+ bool IgnoreTag = false;
+
+ static const char *IntTag;
+ static const char *NilTag;
+ static const char *BooleanTag;
+ static const char *FloatTag;
+ static const char *StringTag;
+ static const char *BinaryTag;
+};
+
+class ArrayNode : public Node, public std::vector<NodePtr> {
+ void anchor() override;
+
+public:
+ ArrayNode() : Node(NK_Array) {}
+ static bool classof(const Node *N) { return N->getKind() == NK_Array; }
+
+ void write(Writer &MPWriter) override {
+ MPWriter.writeArraySize(this->size());
+ for (auto &N : *this)
+ N->write(MPWriter);
+ }
+};
+
+class MapNode : public Node, public StringMap<NodePtr> {
+ void anchor() override;
+
+public:
+ MapNode() : Node(NK_Map) {}
+ static bool classof(const Node *N) { return N->getKind() == NK_Map; }
+
+ void write(Writer &MPWriter) override {
+ MPWriter.writeMapSize(this->size());
+ for (auto &N : *this) {
+ MPWriter.write(N.first());
+ N.second->write(MPWriter);
+ }
+ }
+};
+
+} // end namespace msgpack
+
+namespace yaml {
+
+template <> struct PolymorphicTraits<msgpack::NodePtr> {
+ static NodeKind getKind(const msgpack::NodePtr &N) {
+ if (isa<msgpack::ScalarNode>(*N))
+ return NodeKind::Scalar;
+ if (isa<msgpack::MapNode>(*N))
+ return NodeKind::Map;
+ if (isa<msgpack::ArrayNode>(*N))
+ return NodeKind::Sequence;
+ llvm_unreachable("NodeKind not supported");
+ }
+ static msgpack::ScalarNode &getAsScalar(msgpack::NodePtr &N) {
+ if (!N || !isa<msgpack::ScalarNode>(*N))
+ N.reset(new msgpack::ScalarNode());
+ return *cast<msgpack::ScalarNode>(N.get());
+ }
+ static msgpack::MapNode &getAsMap(msgpack::NodePtr &N) {
+ if (!N || !isa<msgpack::MapNode>(*N))
+ N.reset(new msgpack::MapNode());
+ return *cast<msgpack::MapNode>(N.get());
+ }
+ static msgpack::ArrayNode &getAsSequence(msgpack::NodePtr &N) {
+ if (!N || !isa<msgpack::ArrayNode>(*N))
+ N.reset(new msgpack::ArrayNode());
+ return *cast<msgpack::ArrayNode>(N.get());
+ }
+};
+
+template <> struct TaggedScalarTraits<msgpack::ScalarNode> {
+ static void output(const msgpack::ScalarNode &S, void *Ctxt,
+ raw_ostream &ScalarOS, raw_ostream &TagOS) {
+ if (!S.IgnoreTag)
+ TagOS << S.getYAMLTag();
+ S.outputYAML(ScalarOS);
+ }
+
+ static StringRef input(StringRef ScalarStr, StringRef Tag, void *Ctxt,
+ msgpack::ScalarNode &S) {
+ if (Tag == msgpack::ScalarNode::IntTag) {
+ S.setScalarKind(msgpack::ScalarNode::SK_UInt);
+ if (S.inputYAML(ScalarStr) == StringRef())
+ return StringRef();
+ S.setScalarKind(msgpack::ScalarNode::SK_Int);
+ return S.inputYAML(ScalarStr);
+ }
+
+ if (S.IgnoreTag || Tag == msgpack::ScalarNode::StringTag ||
+ Tag == "tag:yaml.org,2002:str")
+ S.setScalarKind(msgpack::ScalarNode::SK_String);
+ else if (Tag == msgpack::ScalarNode::NilTag)
+ S.setScalarKind(msgpack::ScalarNode::SK_Nil);
+ else if (Tag == msgpack::ScalarNode::BooleanTag)
+ S.setScalarKind(msgpack::ScalarNode::SK_Boolean);
+ else if (Tag == msgpack::ScalarNode::FloatTag)
+ S.setScalarKind(msgpack::ScalarNode::SK_Float);
+ else if (Tag == msgpack::ScalarNode::StringTag)
+ S.setScalarKind(msgpack::ScalarNode::SK_String);
+ else if (Tag == msgpack::ScalarNode::BinaryTag)
+ S.setScalarKind(msgpack::ScalarNode::SK_Binary);
+ else
+ return "Unsupported messagepack tag";
+
+ return S.inputYAML(ScalarStr);
+ }
+
+ static QuotingType mustQuote(const msgpack::ScalarNode &S, StringRef Str) {
+ return S.mustQuoteYAML(Str);
+ }
+};
+
+template <> struct CustomMappingTraits<msgpack::MapNode> {
+ static void inputOne(IO &IO, StringRef Key, msgpack::MapNode &M) {
+ IO.mapRequired(Key.str().c_str(), M[Key]);
+ }
+ static void output(IO &IO, msgpack::MapNode &M) {
+ for (auto &N : M)
+ IO.mapRequired(N.getKey().str().c_str(), N.getValue());
+ }
+};
+
+template <> struct SequenceTraits<msgpack::ArrayNode> {
+ static size_t size(IO &IO, msgpack::ArrayNode &A) { return A.size(); }
+ static msgpack::NodePtr &element(IO &IO, msgpack::ArrayNode &A,
+ size_t Index) {
+ if (Index >= A.size())
+ A.resize(Index + 1);
+ return A[Index];
+ }
+};
+
+} // end namespace yaml
+} // end namespace llvm
+
+#endif // LLVM_BINARYFORMAT_MSGPACKTYPES_H
diff --git a/linux-x64/clang/include/llvm/BinaryFormat/MsgPackWriter.h b/linux-x64/clang/include/llvm/BinaryFormat/MsgPackWriter.h
index 98af422..3b610b7 100644
--- a/linux-x64/clang/include/llvm/BinaryFormat/MsgPackWriter.h
+++ b/linux-x64/clang/include/llvm/BinaryFormat/MsgPackWriter.h
@@ -1,9 +1,8 @@
//===- MsgPackWriter.h - Simple MsgPack writer ------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
diff --git a/linux-x64/clang/include/llvm/BinaryFormat/Wasm.h b/linux-x64/clang/include/llvm/BinaryFormat/Wasm.h
index 44dd92e..51f6ab2 100644
--- a/linux-x64/clang/include/llvm/BinaryFormat/Wasm.h
+++ b/linux-x64/clang/include/llvm/BinaryFormat/Wasm.h
@@ -1,9 +1,8 @@
//===- Wasm.h - Wasm object file format -------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -26,7 +25,7 @@
// Wasm binary format version
const uint32_t WasmVersion = 0x1;
// Wasm linking metadata version
-const uint32_t WasmMetadataVersion = 0x1;
+const uint32_t WasmMetadataVersion = 0x2;
// Wasm uses a 64k page size
const uint32_t WasmPageSize = 65536;
@@ -35,6 +34,20 @@
uint32_t Version;
};
+struct WasmDylinkInfo {
+ uint32_t MemorySize; // Memory size in bytes
+ uint32_t MemoryAlignment; // P2 alignment of memory
+ uint32_t TableSize; // Table size in elements
+ uint32_t TableAlignment; // P2 alignment of table
+ std::vector<StringRef> Needed; // Shared library depenedencies
+};
+
+struct WasmProducerInfo {
+ std::vector<std::pair<std::string, std::string>> Languages;
+ std::vector<std::pair<std::string, std::string>> Tools;
+ std::vector<std::pair<std::string, std::string>> SDKs;
+};
+
struct WasmExport {
StringRef Name;
uint8_t Kind;
@@ -75,6 +88,18 @@
StringRef SymbolName; // from the "linking" section
};
+struct WasmEventType {
+ // Kind of event. Currently only WASM_EVENT_ATTRIBUTE_EXCEPTION is possible.
+ uint32_t Attribute;
+ uint32_t SigIndex;
+};
+
+struct WasmEvent {
+ uint32_t Index;
+ WasmEventType Type;
+ StringRef SymbolName; // from the "linking" section
+};
+
struct WasmImport {
StringRef Module;
StringRef Field;
@@ -84,6 +109,7 @@
WasmGlobalType Global;
WasmTable Table;
WasmLimits Memory;
+ WasmEventType Event;
};
};
@@ -144,7 +170,8 @@
StringRef Name;
uint8_t Kind;
uint32_t Flags;
- StringRef Module; // For undefined symbols the module name of the import
+ StringRef ImportModule; // For undefined symbols the module of the import
+ StringRef ImportName; // For undefined symbols the name of the import
union {
// For function or global symbols, the index in function or global index
// space.
@@ -167,18 +194,20 @@
};
enum : unsigned {
- WASM_SEC_CUSTOM = 0, // Custom / User-defined section
- WASM_SEC_TYPE = 1, // Function signature declarations
- WASM_SEC_IMPORT = 2, // Import declarations
- WASM_SEC_FUNCTION = 3, // Function declarations
- WASM_SEC_TABLE = 4, // Indirect function table and other tables
- WASM_SEC_MEMORY = 5, // Memory attributes
- WASM_SEC_GLOBAL = 6, // Global declarations
- WASM_SEC_EXPORT = 7, // Exports
- WASM_SEC_START = 8, // Start function declaration
- WASM_SEC_ELEM = 9, // Elements section
- WASM_SEC_CODE = 10, // Function bodies (code)
- WASM_SEC_DATA = 11 // Data segments
+ WASM_SEC_CUSTOM = 0, // Custom / User-defined section
+ WASM_SEC_TYPE = 1, // Function signature declarations
+ WASM_SEC_IMPORT = 2, // Import declarations
+ WASM_SEC_FUNCTION = 3, // Function declarations
+ WASM_SEC_TABLE = 4, // Indirect function table and other tables
+ WASM_SEC_MEMORY = 5, // Memory attributes
+ WASM_SEC_GLOBAL = 6, // Global declarations
+ WASM_SEC_EXPORT = 7, // Exports
+ WASM_SEC_START = 8, // Start function declaration
+ WASM_SEC_ELEM = 9, // Elements section
+ WASM_SEC_CODE = 10, // Function bodies (code)
+ WASM_SEC_DATA = 11, // Data segments
+ WASM_SEC_DATACOUNT = 12, // Data segment count
+ WASM_SEC_EVENT = 13 // Event declarations
};
// Type immediate encodings used in various contexts.
@@ -188,7 +217,7 @@
WASM_TYPE_F32 = 0x7D,
WASM_TYPE_F64 = 0x7C,
WASM_TYPE_V128 = 0x7B,
- WASM_TYPE_ANYFUNC = 0x70,
+ WASM_TYPE_FUNCREF = 0x70,
WASM_TYPE_EXCEPT_REF = 0x68,
WASM_TYPE_FUNC = 0x60,
WASM_TYPE_NORESULT = 0x40, // for blocks with no result values
@@ -200,12 +229,13 @@
WASM_EXTERNAL_TABLE = 0x1,
WASM_EXTERNAL_MEMORY = 0x2,
WASM_EXTERNAL_GLOBAL = 0x3,
+ WASM_EXTERNAL_EVENT = 0x4,
};
// Opcodes used in initializer expressions.
enum : unsigned {
WASM_OPCODE_END = 0x0b,
- WASM_OPCODE_GET_GLOBAL = 0x23,
+ WASM_OPCODE_GLOBAL_GET = 0x23,
WASM_OPCODE_I32_CONST = 0x41,
WASM_OPCODE_I64_CONST = 0x42,
WASM_OPCODE_F32_CONST = 0x43,
@@ -214,6 +244,7 @@
enum : unsigned {
WASM_LIMITS_FLAG_HAS_MAX = 0x1,
+ WASM_LIMITS_FLAG_IS_SHARED = 0x2,
};
// Kind codes used in the custom "name" section
@@ -242,6 +273,12 @@
WASM_SYMBOL_TYPE_DATA = 0x1,
WASM_SYMBOL_TYPE_GLOBAL = 0x2,
WASM_SYMBOL_TYPE_SECTION = 0x3,
+ WASM_SYMBOL_TYPE_EVENT = 0x4,
+};
+
+// Kinds of event attributes.
+enum WasmEventAttribute : unsigned {
+ WASM_EVENT_ATTRIBUTE_EXCEPTION = 0x0,
};
const unsigned WASM_SYMBOL_BINDING_MASK = 0x3;
@@ -253,6 +290,8 @@
const unsigned WASM_SYMBOL_VISIBILITY_DEFAULT = 0x0;
const unsigned WASM_SYMBOL_VISIBILITY_HIDDEN = 0x4;
const unsigned WASM_SYMBOL_UNDEFINED = 0x10;
+const unsigned WASM_SYMBOL_EXPORTED = 0x20;
+const unsigned WASM_SYMBOL_EXPLICIT_NAME = 0x40;
#define WASM_RELOC(name, value) name = value,
@@ -273,13 +312,13 @@
};
struct WasmSignature {
- SmallVector<wasm::ValType, 1> Returns;
- SmallVector<wasm::ValType, 4> Params;
+ SmallVector<ValType, 1> Returns;
+ SmallVector<ValType, 4> Params;
// Support empty and tombstone instances, needed by DenseMap.
enum { Plain, Empty, Tombstone } State = Plain;
- WasmSignature(SmallVector<wasm::ValType, 1> &&InReturns,
- SmallVector<wasm::ValType, 4> &&InParams)
+ WasmSignature(SmallVector<ValType, 1> &&InReturns,
+ SmallVector<ValType, 4> &&InParams)
: Returns(InReturns), Params(InParams) {}
WasmSignature() = default;
};
@@ -302,7 +341,7 @@
return !(LHS == RHS);
}
-std::string toString(wasm::WasmSymbolType type);
+std::string toString(WasmSymbolType type);
std::string relocTypetoString(uint32_t type);
} // end namespace wasm
diff --git a/linux-x64/clang/include/llvm/BinaryFormat/WasmRelocs.def b/linux-x64/clang/include/llvm/BinaryFormat/WasmRelocs.def
index 8ffd51e..59a786b 100644
--- a/linux-x64/clang/include/llvm/BinaryFormat/WasmRelocs.def
+++ b/linux-x64/clang/include/llvm/BinaryFormat/WasmRelocs.def
@@ -1,15 +1,15 @@
-
#ifndef WASM_RELOC
#error "WASM_RELOC must be defined"
#endif
-WASM_RELOC(R_WEBASSEMBLY_FUNCTION_INDEX_LEB, 0)
-WASM_RELOC(R_WEBASSEMBLY_TABLE_INDEX_SLEB, 1)
-WASM_RELOC(R_WEBASSEMBLY_TABLE_INDEX_I32, 2)
-WASM_RELOC(R_WEBASSEMBLY_MEMORY_ADDR_LEB, 3)
-WASM_RELOC(R_WEBASSEMBLY_MEMORY_ADDR_SLEB, 4)
-WASM_RELOC(R_WEBASSEMBLY_MEMORY_ADDR_I32, 5)
-WASM_RELOC(R_WEBASSEMBLY_TYPE_INDEX_LEB, 6)
-WASM_RELOC(R_WEBASSEMBLY_GLOBAL_INDEX_LEB, 7)
-WASM_RELOC(R_WEBASSEMBLY_FUNCTION_OFFSET_I32, 8)
-WASM_RELOC(R_WEBASSEMBLY_SECTION_OFFSET_I32, 9)
+WASM_RELOC(R_WASM_FUNCTION_INDEX_LEB, 0)
+WASM_RELOC(R_WASM_TABLE_INDEX_SLEB, 1)
+WASM_RELOC(R_WASM_TABLE_INDEX_I32, 2)
+WASM_RELOC(R_WASM_MEMORY_ADDR_LEB, 3)
+WASM_RELOC(R_WASM_MEMORY_ADDR_SLEB, 4)
+WASM_RELOC(R_WASM_MEMORY_ADDR_I32, 5)
+WASM_RELOC(R_WASM_TYPE_INDEX_LEB, 6)
+WASM_RELOC(R_WASM_GLOBAL_INDEX_LEB, 7)
+WASM_RELOC(R_WASM_FUNCTION_OFFSET_I32, 8)
+WASM_RELOC(R_WASM_SECTION_OFFSET_I32, 9)
+WASM_RELOC(R_WASM_EVENT_INDEX_LEB, 10)