summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/WasmObjectFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Object/WasmObjectFile.cpp')
-rw-r--r--llvm/lib/Object/WasmObjectFile.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp
index 8b31c04a37a..388e04964b2 100644
--- a/llvm/lib/Object/WasmObjectFile.cpp
+++ b/llvm/lib/Object/WasmObjectFile.cpp
@@ -35,6 +35,19 @@
using namespace llvm;
using namespace object;
+void WasmSymbol::print(raw_ostream &Out) const {
+ Out << "Name=" << Info.Name
+ << ", Kind=" << toString(wasm::WasmSymbolType(Info.Kind))
+ << ", Flags=" << Info.Flags;
+ if (!isTypeData()) {
+ Out << ", ElemIndex=" << Info.ElementIndex;
+ } else if (isDefined()) {
+ Out << ", Segment=" << Info.DataRef.Segment;
+ Out << ", Offset=" << Info.DataRef.Offset;
+ Out << ", Size=" << Info.DataRef.Size;
+ }
+}
+
Expected<std::unique_ptr<WasmObjectFile>>
ObjectFile::createWasmObjectFile(MemoryBufferRef Buffer) {
Error Err = Error::success();
OpenPOWER on IntegriCloud