LLVM 19.0.0git
WasmObject.cpp
Go to the documentation of this file.
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//===----------------------------------------------------------------------===//
8
9#include "WasmObject.h"
10
11#include "llvm/Support/LEB128.h"
13
14namespace llvm {
15namespace objcopy {
16namespace wasm {
17
18using namespace object;
19using namespace llvm::wasm;
20
22 Section NewSection, std::unique_ptr<MemoryBuffer> &&Content) {
23 Sections.push_back(NewSection);
24 OwnedContents.emplace_back(std::move(Content));
25}
26
28 // TODO: remove reloc sections for the removed section, handle symbols, etc.
30}
31
32} // end namespace wasm
33} // end namespace objcopy
34} // end namespace llvm
ReachingDefAnalysis InstSet & ToRemove
T Content
An efficient, type-erasing, non-owning reference to a callable.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
void erase_if(Container &C, UnaryPredicate P)
Provide a container algorithm similar to C++ Library Fundamentals v2's erase_if which is equivalent t...
Definition: STLExtras.h:2060
std::vector< Section > Sections
Definition: WasmObject.h:34
void addSectionWithOwnedContents(Section NewSection, std::unique_ptr< MemoryBuffer > &&Content)
Definition: WasmObject.cpp:21
void removeSections(function_ref< bool(const Section &)> ToRemove)
Definition: WasmObject.cpp:27