15#define DEBUG_TYPE "cg-data-writer" 
   23  case OStreamKind::fd: {
 
   26    for (
const auto &K : 
P) {
 
   27      FDOStream.
seek(K.Pos);
 
   28      for (
size_t I = 0; 
I < K.D.size(); ++
I)
 
   34    FDOStream.
seek(LastPos);
 
   37  case OStreamKind::string: {
 
   39    std::string &
Data = SOStream.
str(); 
 
   40    for (
const auto &K : 
P) {
 
   41      for (
size_t I = 0; 
I < K.D.size(); ++
I) {
 
   45                     reinterpret_cast<const char *
>(&Bytes), 
sizeof(
uint64_t));
 
   50  case OStreamKind::svector: {
 
   52    for (
const auto &K : 
P) {
 
   53      for (
size_t I = 0; 
I < K.D.size(); ++
I) {
 
   56        VOStream.
pwrite(
reinterpret_cast<const char *
>(&Bytes),
 
 
   66  assert(
Record.HashTree && 
"empty hash tree in the record");
 
   67  HashTreeRecord.HashTree = std::move(
Record.HashTree);
 
 
   73  assert(
Record.FunctionMap && 
"empty function map in the record");
 
   74  FunctionMapRecord.FunctionMap = std::move(
Record.FunctionMap);
 
 
   81  return writeImpl(COS);
 
 
   98  Header.OutlinedHashTreeOffset = 0;
 
   99  Header.StableFunctionMapOffset = 0;
 
  103  COS.
write(Header.Magic);
 
  108  OutlinedHashTreeOffset = COS.
tell();
 
  114  StableFunctionMapOffset = COS.
tell();
 
  123  if (
Error E = writeHeader(COS))
 
  126  std::vector<CGDataPatchItem> PatchItems;
 
  136  PatchItems.emplace_back(OutlinedHashTreeOffset, &OutlinedHashTreeFieldStart,
 
  138  PatchItems.emplace_back(StableFunctionMapOffset, &StableFunctionMapFieldStart,
 
  140  COS.
patch(PatchItems);
 
  147    OS << 
"# Outlined stable hash tree\n:outlined_hash_tree\n";
 
  150    OS << 
"# Stable function map\n:stable_function_map\n";
 
  158  if (
Error E = writeHeaderText(OS))
 
  163    HashTreeRecord.serializeYAML(YOS);
 
  166    FunctionMapRecord.serializeYAML(YOS);
 
 
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
 
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
 
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
 
A wrapper class to abstract writer stream with support of bytes back patching.
 
LLVM_ABI void patch(ArrayRef< CGDataPatchItem > P)
 
LLVM_ABI Error writeText(raw_fd_ostream &OS)
Write the codegen data in text format to OS.
 
LLVM_ABI Error write(raw_fd_ostream &OS)
Write the codegen data to OS.
 
bool hasOutlinedHashTree() const
Return true if the header indicates the data has an outlined hash tree.
 
bool hasStableFunctionMap() const
Return true if the header indicates the data has a stable function map.
 
LLVM_ABI void addRecord(OutlinedHashTreeRecord &Record)
Add the outlined hash tree record. The input hash tree is released.
 
Lightweight error class with error context and mandatory checking.
 
static ErrorSuccess success()
Create a success value.
 
A raw_ostream that writes to a file descriptor.
 
uint64_t seek(uint64_t off)
Flushes the stream and repositions the underlying file descriptor position to the offset specified fr...
 
uint64_t tell() const
tell - Return the current offset with the file.
 
void pwrite(const char *Ptr, size_t Size, uint64_t Offset)
 
A raw_ostream that writes to an std::string.
 
std::string & str()
Returns the string's reference.
 
A raw_ostream that writes to an SmallVector or SmallString.
 
The Output class is used to generate a yaml document from in-memory structs and vectors.
 
value_type byte_swap(value_type value, endianness endian)
 
This is an optimization pass for GlobalISel generic memory operations.
 
@ StableFunctionMergingMap
 
@ FunctionOutlinedHashTree
 
FunctionAddr VTableAddr uintptr_t uintptr_t Data
 
LLVM_ABI void serialize(raw_ostream &OS) const
Serialize the outlined hash tree to a raw_ostream.
 
The structure of the serialized stable function map is as follows:
 
static LLVM_ABI void serialize(raw_ostream &OS, const StableFunctionMap *FunctionMap, std::vector< CGDataPatchItem > &PatchItems)
A static helper function to serialize the stable function map without owning the stable function map.