summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Object/Wasm.h7
-rw-r--r--llvm/include/llvm/ObjectYAML/WasmYAML.h23
-rw-r--r--llvm/include/llvm/Support/Wasm.h23
3 files changed, 30 insertions, 23 deletions
diff --git a/llvm/include/llvm/Object/Wasm.h b/llvm/include/llvm/Object/Wasm.h
index 4bc39d98b7a..d200d4a148e 100644
--- a/llvm/include/llvm/Object/Wasm.h
+++ b/llvm/include/llvm/Object/Wasm.h
@@ -67,7 +67,8 @@ public:
WasmObjectFile(MemoryBufferRef Object, Error &Err);
const wasm::WasmObjectHeader &getHeader() const;
- const WasmSymbol &getWasmSymbol(DataRefImpl Symb) const;
+ const WasmSymbol &getWasmSymbol(const DataRefImpl &Symb) const;
+ const WasmSymbol &getWasmSymbol(const SymbolRef &Symbol) const;
const WasmSection &getWasmSection(const SectionRef &Section) const;
const wasm::WasmRelocation &getWasmRelocation(const RelocationRef& Ref) const;
@@ -81,6 +82,10 @@ public:
const std::vector<wasm::WasmGlobal>& globals() const { return Globals; }
const std::vector<wasm::WasmExport>& exports() const { return Exports; }
+ uint32_t getNumberOfSymbols() const {
+ return Symbols.size();
+ }
+
const std::vector<wasm::WasmElemSegment>& elements() const {
return ElemSegments;
}
diff --git a/llvm/include/llvm/ObjectYAML/WasmYAML.h b/llvm/include/llvm/ObjectYAML/WasmYAML.h
index bd7d72be4db..747cd624055 100644
--- a/llvm/include/llvm/ObjectYAML/WasmYAML.h
+++ b/llvm/include/llvm/ObjectYAML/WasmYAML.h
@@ -34,17 +34,6 @@ struct FileHeader {
yaml::Hex32 Version;
};
-struct Import {
- StringRef Module;
- StringRef Field;
- ExportKind Kind;
- union {
- uint32_t SigIndex;
- ValueType GlobalType;
- };
- bool GlobalMutable;
-};
-
struct Limits {
yaml::Hex32 Flags;
yaml::Hex32 Initial;
@@ -74,6 +63,18 @@ struct Global {
wasm::WasmInitExpr InitExpr;
};
+struct Import {
+ StringRef Module;
+ StringRef Field;
+ ExportKind Kind;
+ union {
+ uint32_t SigIndex;
+ Global Global;
+ Table Table;
+ Limits Memory;
+ };
+};
+
struct LocalDecl {
ValueType Type;
uint32_t Count;
diff --git a/llvm/include/llvm/Support/Wasm.h b/llvm/include/llvm/Support/Wasm.h
index a48dfe10b3b..e3831827062 100644
--- a/llvm/include/llvm/Support/Wasm.h
+++ b/llvm/include/llvm/Support/Wasm.h
@@ -37,17 +37,6 @@ struct WasmSignature {
int32_t ReturnType;
};
-struct WasmImport {
- StringRef Module;
- StringRef Field;
- uint32_t Kind;
- union {
- uint32_t SigIndex;
- int32_t GlobalType;
- };
- bool GlobalMutable;
-};
-
struct WasmExport {
StringRef Name;
uint32_t Kind;
@@ -82,6 +71,18 @@ struct WasmGlobal {
WasmInitExpr InitExpr;
};
+struct WasmImport {
+ StringRef Module;
+ StringRef Field;
+ uint32_t Kind;
+ union {
+ uint32_t SigIndex;
+ WasmGlobal Global;
+ WasmTable Table;
+ WasmLimits Memory;
+ };
+};
+
struct WasmLocalDecl {
int32_t Type;
uint32_t Count;
OpenPOWER on IntegriCloud