Update clang to r339409b.
Change-Id: Ied8a188bb072c40035320acedc86164b66d920af
diff --git a/linux-x64/clang/include/llvm/BinaryFormat/Wasm.h b/linux-x64/clang/include/llvm/BinaryFormat/Wasm.h
index fa5448d..44dd92e 100644
--- a/linux-x64/clang/include/llvm/BinaryFormat/Wasm.h
+++ b/linux-x64/clang/include/llvm/BinaryFormat/Wasm.h
@@ -16,6 +16,7 @@
#define LLVM_BINARYFORMAT_WASM_H
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/SmallVector.h"
namespace llvm {
namespace wasm {
@@ -34,11 +35,6 @@
uint32_t Version;
};
-struct WasmSignature {
- std::vector<uint8_t> ParamTypes;
- uint8_t ReturnType;
-};
-
struct WasmExport {
StringRef Name;
uint8_t Kind;
@@ -104,8 +100,8 @@
uint32_t Size;
uint32_t CodeOffset; // start of Locals and Body
StringRef SymbolName; // from the "linking" section
- StringRef DebugName; // from the "name" section
- uint32_t Comdat; // from the "comdat info" section
+ StringRef DebugName; // from the "name" section
+ uint32_t Comdat; // from the "comdat info" section
};
struct WasmDataSegment {
@@ -191,6 +187,7 @@
WASM_TYPE_I64 = 0x7E,
WASM_TYPE_F32 = 0x7D,
WASM_TYPE_F64 = 0x7C,
+ WASM_TYPE_V128 = 0x7B,
WASM_TYPE_ANYFUNC = 0x70,
WASM_TYPE_EXCEPT_REF = 0x68,
WASM_TYPE_FUNC = 0x60,
@@ -219,33 +216,24 @@
WASM_LIMITS_FLAG_HAS_MAX = 0x1,
};
-// Subset of types that a value can have
-enum class ValType {
- I32 = WASM_TYPE_I32,
- I64 = WASM_TYPE_I64,
- F32 = WASM_TYPE_F32,
- F64 = WASM_TYPE_F64,
- EXCEPT_REF = WASM_TYPE_EXCEPT_REF,
-};
-
// Kind codes used in the custom "name" section
enum : unsigned {
WASM_NAMES_FUNCTION = 0x1,
- WASM_NAMES_LOCAL = 0x2,
+ WASM_NAMES_LOCAL = 0x2,
};
// Kind codes used in the custom "linking" section
enum : unsigned {
- WASM_SEGMENT_INFO = 0x5,
- WASM_INIT_FUNCS = 0x6,
- WASM_COMDAT_INFO = 0x7,
- WASM_SYMBOL_TABLE = 0x8,
+ WASM_SEGMENT_INFO = 0x5,
+ WASM_INIT_FUNCS = 0x6,
+ WASM_COMDAT_INFO = 0x7,
+ WASM_SYMBOL_TABLE = 0x8,
};
// Kind codes used in the custom "linking" section in the WASM_COMDAT_INFO
enum : unsigned {
- WASM_COMDAT_DATA = 0x0,
- WASM_COMDAT_FUNCTION = 0x1,
+ WASM_COMDAT_DATA = 0x0,
+ WASM_COMDAT_FUNCTION = 0x1,
};
// Kind codes used in the custom "linking" section in the WASM_SYMBOL_TABLE
@@ -256,15 +244,15 @@
WASM_SYMBOL_TYPE_SECTION = 0x3,
};
-const unsigned WASM_SYMBOL_BINDING_MASK = 0x3;
-const unsigned WASM_SYMBOL_VISIBILITY_MASK = 0xc;
+const unsigned WASM_SYMBOL_BINDING_MASK = 0x3;
+const unsigned WASM_SYMBOL_VISIBILITY_MASK = 0xc;
-const unsigned WASM_SYMBOL_BINDING_GLOBAL = 0x0;
-const unsigned WASM_SYMBOL_BINDING_WEAK = 0x1;
-const unsigned WASM_SYMBOL_BINDING_LOCAL = 0x2;
+const unsigned WASM_SYMBOL_BINDING_GLOBAL = 0x0;
+const unsigned WASM_SYMBOL_BINDING_WEAK = 0x1;
+const unsigned WASM_SYMBOL_BINDING_LOCAL = 0x2;
const unsigned WASM_SYMBOL_VISIBILITY_DEFAULT = 0x0;
-const unsigned WASM_SYMBOL_VISIBILITY_HIDDEN = 0x4;
-const unsigned WASM_SYMBOL_UNDEFINED = 0x10;
+const unsigned WASM_SYMBOL_VISIBILITY_HIDDEN = 0x4;
+const unsigned WASM_SYMBOL_UNDEFINED = 0x10;
#define WASM_RELOC(name, value) name = value,
@@ -274,9 +262,32 @@
#undef WASM_RELOC
+// Subset of types that a value can have
+enum class ValType {
+ I32 = WASM_TYPE_I32,
+ I64 = WASM_TYPE_I64,
+ F32 = WASM_TYPE_F32,
+ F64 = WASM_TYPE_F64,
+ V128 = WASM_TYPE_V128,
+ EXCEPT_REF = WASM_TYPE_EXCEPT_REF,
+};
+
+struct WasmSignature {
+ SmallVector<wasm::ValType, 1> Returns;
+ SmallVector<wasm::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)
+ : Returns(InReturns), Params(InParams) {}
+ WasmSignature() = default;
+};
+
// Useful comparison operators
inline bool operator==(const WasmSignature &LHS, const WasmSignature &RHS) {
- return LHS.ReturnType == RHS.ReturnType && LHS.ParamTypes == RHS.ParamTypes;
+ return LHS.State == RHS.State && LHS.Returns == RHS.Returns &&
+ LHS.Params == RHS.Params;
}
inline bool operator!=(const WasmSignature &LHS, const WasmSignature &RHS) {