LLVM
17.0.0git
lib
ObjCopy
wasm
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
"
12
#include "
llvm/Support/raw_ostream.h
"
13
14
namespace
llvm
{
15
namespace
objcopy {
16
namespace
wasm {
17
18
using namespace
object
;
19
using namespace
llvm::wasm
;
20
21
void
Object::addSectionWithOwnedContents
(
22
Section
NewSection, std::unique_ptr<MemoryBuffer> &&
Content
) {
23
Sections.push_back(NewSection);
24
OwnedContents.emplace_back(
std::move
(
Content
));
25
}
26
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
);
30
}
31
32
}
// end namespace wasm
33
}
// end namespace objcopy
34
}
// end namespace llvm
llvm::objcopy::wasm::Object::removeSections
void removeSections(function_ref< bool(const Section &)> ToRemove)
Definition:
WasmObject.cpp:27
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:
AddressRanges.h:18
llvm::objcopy::wasm::Object::addSectionWithOwnedContents
void addSectionWithOwnedContents(Section NewSection, std::unique_ptr< MemoryBuffer > &&Content)
Definition:
WasmObject.cpp:21
ToRemove
ReachingDefAnalysis InstSet & ToRemove
Definition:
ARMLowOverheadLoops.cpp:547
llvm::erase_if
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:1998
Content
T Content
Definition:
ELFObjHandler.cpp:89
llvm::function_ref
An efficient, type-erasing, non-owning reference to a callable.
Definition:
STLFunctionalExtras.h:36
llvm::objcopy::wasm::Section
Definition:
WasmObject.h:22
object
bar al al movzbl eax ret Missed when stored in a memory object
Definition:
README.txt:1411
LEB128.h
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition:
README.txt:546
llvm::wasm
Definition:
Wasm.h:23
raw_ostream.h
WasmObject.h
Generated on Fri Jan 27 2023 12:41:04 for LLVM by
1.8.17