LLVM 23.0.0git
llvm::DWPWriter Class Reference

Direct ELF writer for DWP output, bypassing MCStreamer. More...

#include "llvm/DWP/DWP.h"

Public Member Functions

 DWPWriter ()=default
void setMachine (uint16_t Machine)
void setOSABI (uint8_t OSABI)
void setIsWASM (bool V)
SmallVectorImpl< char > & getSectionBuffer (DWPSectionId Id)
void switchSection (DWPSectionId Id)
void emitBytes (StringRef Data)
 Zero-copy: stores a reference to the input data without copying.
void emitIntValue (uint64_t Value, unsigned Size)
Error writeELF (raw_pwrite_stream &OS)
Error writeWASM (raw_pwrite_stream &OS)
Error write (raw_pwrite_stream &OS)

Detailed Description

Direct ELF writer for DWP output, bypassing MCStreamer.

Section data is stored as zero-copy StringRef chunks pointing to the mmap'd input files, plus an inline buffer for constructed data (emitIntValue). This avoids copying gigabytes of debug section data through the MC infrastructure (MCContext, MCAssembler, MCDataFragment allocation, layout, etc.).

Definition at line 60 of file DWP.h.

Constructor & Destructor Documentation

◆ DWPWriter()

llvm::DWPWriter::DWPWriter ( )
default

Member Function Documentation

◆ emitBytes()

void llvm::DWPWriter::emitBytes ( StringRef Data)
inline

Zero-copy: stores a reference to the input data without copying.

Flushes any pending inline data first to preserve output order.

Definition at line 122 of file DWP.h.

References llvm::Data.

Referenced by addAllTypesFromDWP(), addAllTypesFromTypesSection(), llvm::handleSection(), llvm::write(), and llvm::writeStringsAndOffsets().

◆ emitIntValue()

void llvm::DWPWriter::emitIntValue ( uint64_t Value,
unsigned Size )
inline

Definition at line 130 of file DWP.h.

References I, and Size.

Referenced by llvm::writeIndex(), llvm::writeIndexTable(), writeNewOffsetsTo(), and llvm::writeStringsAndOffsets().

◆ getSectionBuffer()

SmallVectorImpl< char > & llvm::DWPWriter::getSectionBuffer ( DWPSectionId Id)
inline

Definition at line 114 of file DWP.h.

Referenced by llvm::write().

◆ setIsWASM()

void llvm::DWPWriter::setIsWASM ( bool V)
inline

Definition at line 112 of file DWP.h.

Referenced by llvm::write().

◆ setMachine()

void llvm::DWPWriter::setMachine ( uint16_t Machine)
inline

Definition at line 110 of file DWP.h.

References Machine.

Referenced by llvm::write().

◆ setOSABI()

void llvm::DWPWriter::setOSABI ( uint8_t OSABI)
inline

Definition at line 111 of file DWP.h.

Referenced by llvm::write().

◆ switchSection()

void llvm::DWPWriter::switchSection ( DWPSectionId Id)
inline

◆ write()

Error llvm::DWPWriter::write ( raw_pwrite_stream & OS)
inline

Definition at line 140 of file DWP.h.

References writeELF(), and writeWASM().

Referenced by llvm::write().

◆ writeELF()

◆ writeWASM()


The documentation for this class was generated from the following files: