[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / llvm / lib / ObjCopy / wasm / WasmObject.cpp
blob28a2de6e6e4f12499c97d984dce2729e25333778
1 //===- WasmObject.cpp -----------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "WasmObject.h"
11 #include "llvm/Support/LEB128.h"
12 #include "llvm/Support/raw_ostream.h"
14 namespace llvm {
15 namespace objcopy {
16 namespace wasm {
18 using namespace object;
19 using namespace llvm::wasm;
21 void Object::addSectionWithOwnedContents(
22 Section NewSection, std::unique_ptr<MemoryBuffer> &&Content) {
23 Sections.push_back(NewSection);
24 OwnedContents.emplace_back(std::move(Content));
27 void Object::removeSections(function_ref<bool(const Section &)> ToRemove) {
28 // TODO: remove reloc sections for the removed section, handle symbols, etc.
29 llvm::erase_if(Sections, ToRemove);
32 } // end namespace wasm
33 } // end namespace objcopy
34 } // end namespace llvm