Go to the documentation of this file.
21 S.UniqueId = NextSymbolUniqueId++;
22 Symbols.emplace_back(
S);
27 void Object::updateSymbols() {
29 for (
Symbol &Sym : Symbols)
54 for (
Symbol &Sym : Symbols)
55 Sym.Referenced =
false;
56 for (
const Section &Sec : Sections) {
61 "relocation target %zu not found", R.Target);
62 It->second->Referenced =
true;
70 S.UniqueId = NextSectionUniqueId++;
71 Sections.emplace_back(
S);
76 void Object::updateSections() {
80 SectionMap[
S.UniqueId] = &
S;
86 return SectionMap.lookup(UniqueId);
91 auto RemoveAssociated = [&AssociatedSections](
const Section &Sec) {
92 return AssociatedSections.
contains(Sec.UniqueId);
103 AssociatedSections.
clear();
105 Symbols, [&RemovedSections, &AssociatedSections](
const Symbol &Sym) {
115 }
while (!AssociatedSections.
empty());
121 for (
Section &Sec : Sections) {
122 if (ToTruncate(Sec)) {
125 Sec.Header.SizeOfRawData = 0;
This is an optimization pass for GlobalISel generic memory operations.
ValueT lookup(const_arg_type_t< KeyT > Val) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
ReachingDefAnalysis InstSet & ToRemove
static ErrorSuccess success()
Create a success value.
void erase_if(Container &C, UnaryPredicate P)
Provide a container algorithm similar to C++ Library Fundamentals v2's erase_if which is equivalent t...
Error removeSymbols(function_ref< Expected< bool >(const Symbol &)> ToRemove)
void truncateSections(function_ref< bool(const Section &)> ToTruncate)
Tagged union holding either a T or a Error.
std::pair< iterator, bool > insert(const ValueT &V)
void removeSections(function_ref< bool(const Section &)> ToRemove)
void addSections(ArrayRef< Section > NewSections)
DenseMap< SymbolStringPtr, JITEvaluatedSymbol > SymbolMap
A map from symbol names (as SymbolStringPtrs) to JITSymbols (address/flags pairs).
An efficient, type-erasing, non-owning reference to a callable.
Implements a dense probed hash-table based set.
const Section * findSection(ssize_t UniqueId) const
bar al al movzbl eax ret Missed when stored in a memory object
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
Error joinErrors(Error E1, Error E2)
Concatenate errors.
iterator find(const_arg_type_t< KeyT > Val)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
bool contains(const_arg_type_t< ValueT > V) const
Check if the set contains the given element.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
const Symbol * findSymbol(size_t UniqueId) const
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
ssize_t AssociativeComdatTargetSectionId
Lightweight error class with error context and mandatory checking.
void addSymbols(ArrayRef< Symbol > NewSymbols)
Error takeError()
Take ownership of the stored error.