12#define DEBUG_TYPE "jitlink"
26 <<
" section. Nothing to do\n";
41 Caches[
B] = LinkGraph::SplitBlockCache::value_type();
43 Caches[&
Sym->getBlock()]->push_back(
Sym);
46 return LHS->getOffset() >
RHS->getOffset();
53 for (
auto &KV : Caches) {
55 auto &BCache = KV.second;
56 if (
auto Err = processBlock(
G,
B, BCache))
63Error DWARFRecordSectionSplitter::processBlock(
65 LLVM_DEBUG(
dbgs() <<
" Processing block at " <<
B.getAddress() <<
"\n");
69 return make_error<JITLinkError>(
"Unexpected zero-fill block in " +
72 if (
B.getSize() == 0) {
78 StringRef(
B.getContent().data(),
B.getContent().size()),
82 uint64_t RecordStartOffset = BlockReader.getOffset();
85 dbgs() <<
" Processing CFI record at "
86 <<
formatv(
"{0:x16}",
B.getAddress()) <<
"\n";
90 if (
auto Err = BlockReader.readInteger(
Length))
92 if (
Length != 0xffffffff) {
93 if (
auto Err = BlockReader.skip(
Length))
97 if (
auto Err = BlockReader.readInteger(ExtendedLength))
99 if (
auto Err = BlockReader.skip(ExtendedLength))
104 if (BlockReader.empty()) {
110 auto &NewBlock =
G.splitBlock(
B,
BlockSize, &Cache);
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static const int BlockSize
Provides read only access to a subclass of BinaryStream.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
StringRef - Represent a constant reference to a string, i.e.
An Addressable with content and edges.
DWARFRecordSectionSplitter(StringRef SectionName)
Error operator()(LinkGraph &G)
std::optional< SmallVector< Symbol *, 8 > > SplitBlockCache
Cache type for the splitBlock function.
Represents an object file section.
iterator_range< symbol_iterator > symbols()
Returns an iterator over the symbols defined in this section.
iterator_range< block_iterator > blocks()
Returns an iterator over the blocks defined in this section.
This is an optimization pass for GlobalISel generic memory operations.
auto formatv(const char *Fmt, Ts &&...Vals) -> formatv_object< decltype(std::make_tuple(support::detail::build_format_adapter(std::forward< Ts >(Vals))...))>
void sort(IteratorTy Start, IteratorTy End)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.