Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
MCDwarf.cpp File Reference
#include "llvm/MC/MCDwarf.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/Config/config.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCObjectFileInfo.h"
#include "llvm/MC/MCObjectStreamer.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/EndianStream.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cstdint>
#include <optional>
#include <string>
#include <utility>
#include <vector>

Go to the source code of this file.

Functions

static uint64_t ScaleAddrDelta (MCContext &Context, uint64_t AddrDelta)
static const MCExprmakeEndMinusStartExpr (MCContext &Ctx, const MCSymbol &Start, const MCSymbol &End, int IntVal)
static const MCExprmakeStartPlusIntExpr (MCContext &Ctx, const MCSymbol &Start, int IntVal)
static const MCExprforceExpAbs (MCStreamer &OS, const MCExpr *Expr)
static void emitAbsValue (MCStreamer &OS, const MCExpr *Value, unsigned Size)
static void emitOneV5FileEntry (MCStreamer *MCOS, const MCDwarfFile &DwarfFile, bool EmitMD5, bool HasAnySource, std::optional< MCDwarfLineStr > &LineStr)
static bool isRootFile (const MCDwarfFile &RootFile, StringRef &Directory, StringRef &FileName, std::optional< MD5::MD5Result > Checksum)
static uint64_t SpecialAddr (MCDwarfLineTableParams Params, uint64_t op)
 Given a special op, return the address skip amount (in units of DWARF2_LINE_MIN_INSN_LENGTH).
static void EmitAbbrev (MCStreamer *MCOS, uint64_t Name, uint64_t Form)
static void EmitGenDwarfAbbrev (MCStreamer *MCOS)
static void EmitGenDwarfAranges (MCStreamer *MCOS, const MCSymbol *InfoSectionSymbol)
static void EmitGenDwarfInfo (MCStreamer *MCOS, const MCSymbol *AbbrevSectionSymbol, const MCSymbol *LineSectionSymbol, const MCSymbol *RangesSymbol)
static MCSymbolemitGenDwarfRanges (MCStreamer *MCOS)
static int getDataAlignmentFactor (MCStreamer &streamer)
static unsigned getSizeForEncoding (MCStreamer &streamer, unsigned symbolEncoding)
static void emitFDESymbol (MCObjectStreamer &streamer, const MCSymbol &symbol, unsigned symbolEncoding, bool isEH)
static void EmitPersonality (MCStreamer &streamer, const MCSymbol &symbol, unsigned symbolEncoding)
static void emitEncodingByte (MCObjectStreamer &Streamer, unsigned Encoding)
static unsigned getCIEVersion (bool IsEH, unsigned DwarfVersion)

Function Documentation

◆ EmitAbbrev()

void EmitAbbrev ( MCStreamer * MCOS,
uint64_t Name,
uint64_t Form )
static

Definition at line 829 of file MCDwarf.cpp.

References llvm::MCStreamer::emitULEB128IntValue().

Referenced by EmitGenDwarfAbbrev().

◆ emitAbsValue()

void emitAbsValue ( MCStreamer & OS,
const MCExpr * Value,
unsigned Size )
static

◆ emitEncodingByte()

void emitEncodingByte ( MCObjectStreamer & Streamer,
unsigned Encoding )
static

Definition at line 1376 of file MCDwarf.cpp.

References llvm::MCStreamer::emitInt8().

◆ emitFDESymbol()

◆ EmitGenDwarfAbbrev()

◆ EmitGenDwarfAranges()

◆ EmitGenDwarfInfo()

void EmitGenDwarfInfo ( MCStreamer * MCOS,
const MCSymbol * AbbrevSectionSymbol,
const MCSymbol * LineSectionSymbol,
const MCSymbol * RangesSymbol )
static

Definition at line 963 of file MCDwarf.cpp.

References assert(), llvm::MCSymbolRefExpr::create(), llvm::MCContext::createTempSymbol(), llvm::dwarf::DW_LENGTH_DWARF64, llvm::dwarf::DWARF64, emitAbsValue(), llvm::MCStreamer::emitBytes(), llvm::MCStreamer::emitInt16(), llvm::MCStreamer::emitInt32(), llvm::MCStreamer::emitInt8(), llvm::MCStreamer::emitIntValue(), llvm::MCStreamer::emitLabel(), llvm::MCStreamer::emitSymbolValue(), llvm::MCStreamer::emitULEB128IntValue(), llvm::MCStreamer::emitValue(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::StringRef::empty(), llvm::sys::path::get_separator(), llvm::MCContext::getAsmInfo(), llvm::MCAsmInfo::getCodePointerSize(), llvm::MCContext::getCompilationDir(), llvm::MCStreamer::getContext(), llvm::MCContext::getDwarfDebugFlags(), llvm::MCContext::getDwarfDebugProducer(), llvm::MCContext::getDwarfFormat(), llvm::MCObjectFileInfo::getDwarfInfoSection(), llvm::dwarf::getDwarfOffsetByteSize(), llvm::MCContext::getDwarfVersion(), llvm::MCContext::getGenDwarfSectionSyms(), llvm::MCContext::getMCDwarfDirs(), llvm::MCContext::getMCDwarfFiles(), llvm::MCContext::getMCDwarfLineTable(), llvm::MCContext::getMCGenDwarfLabelEntries(), llvm::MCContext::getObjectFileInfo(), llvm::MCDwarfLineTable::getRootFile(), llvm::dwarf::getUnitLengthFieldByteSize(), llvm::Length, makeEndMinusStartExpr(), llvm::MCDwarfFile::Name, llvm::MCAsmInfo::needsDwarfSectionOffsetDirective(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and llvm::MCStreamer::switchSection().

Referenced by llvm::MCGenDwarfInfo::Emit().

◆ emitGenDwarfRanges()

◆ emitOneV5FileEntry()

void emitOneV5FileEntry ( MCStreamer * MCOS,
const MCDwarfFile & DwarfFile,
bool EmitMD5,
bool HasAnySource,
std::optional< MCDwarfLineStr > & LineStr )
static

◆ EmitPersonality()

◆ forceExpAbs()

const MCExpr * forceExpAbs ( MCStreamer & OS,
const MCExpr * Expr )
static

◆ getCIEVersion()

unsigned getCIEVersion ( bool IsEH,
unsigned DwarfVersion )
static

Definition at line 1635 of file MCDwarf.cpp.

References llvm_unreachable.

◆ getDataAlignmentFactor()

◆ getSizeForEncoding()

◆ isRootFile()

bool isRootFile ( const MCDwarfFile & RootFile,
StringRef & Directory,
StringRef & FileName,
std::optional< MD5::MD5Result > Checksum )
static

◆ makeEndMinusStartExpr()

const MCExpr * makeEndMinusStartExpr ( MCContext & Ctx,
const MCSymbol & Start,
const MCSymbol & End,
int IntVal )
inlinestatic

◆ makeStartPlusIntExpr()

const MCExpr * makeStartPlusIntExpr ( MCContext & Ctx,
const MCSymbol & Start,
int IntVal )
inlinestatic

◆ ScaleAddrDelta()

uint64_t ScaleAddrDelta ( MCContext & Context,
uint64_t AddrDelta )
inlinestatic

◆ SpecialAddr()

uint64_t SpecialAddr ( MCDwarfLineTableParams Params,
uint64_t op )
static

Given a special op, return the address skip amount (in units of DWARF2_LINE_MIN_INSN_LENGTH).

Definition at line 740 of file MCDwarf.cpp.

References llvm::MCDwarfLineTableParams::DWARF2LineOpcodeBase, llvm::MCDwarfLineTableParams::DWARF2LineRange, and op.

Referenced by llvm::MCDwarfLineAddr::encode().