diff --git a/include/llvm/Object/Wasm.h b/include/llvm/Object/Wasm.h index 146b34af198..c9e630bccb3 100644 --- a/include/llvm/Object/Wasm.h +++ b/include/llvm/Object/Wasm.h @@ -88,18 +88,7 @@ public: return Info.Flags & wasm::WASM_SYMBOL_VISIBILITY_MASK; } - void 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; - } - } + void print(raw_ostream &Out) const; #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) LLVM_DUMP_METHOD void dump() const { print(dbgs()); } diff --git a/lib/Object/WasmObjectFile.cpp b/lib/Object/WasmObjectFile.cpp index 8b31c04a37a..388e04964b2 100644 --- a/lib/Object/WasmObjectFile.cpp +++ b/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> ObjectFile::createWasmObjectFile(MemoryBufferRef Buffer) { Error Err = Error::success();