LLVM
8.0.1
|
#include "llvm/MC/MCDwarf.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/Optional.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/MC/StringTableBuilder.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Endian.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 <string>
#include <utility>
#include <vector>
Go to the source code of this file.
Classes | |
class | llvm::MCDwarfLineStr |
Manage the .debug_line_str section contents, if we use it. More... | |
struct | llvm::DenseMapInfo< CIEKey > |
Namespaces | |
llvm | |
This class represents lattice values for constants. | |
Functions | |
static uint64_t | ScaleAddrDelta (MCContext &Context, uint64_t AddrDelta) |
static const MCExpr * | MakeStartMinusEndExpr (const MCStreamer &MCOS, const MCSymbol &Start, const MCSymbol &End, int IntVal) |
static const MCExpr * | makeStartPlusIntExpr (MCContext &Ctx, const MCSymbol &Start, int IntVal) |
static void | EmitDwarfLineTable (MCObjectStreamer *MCOS, MCSection *Section, const MCLineSection::MCDwarfLineEntryCollection &LineEntries) |
static const MCExpr * | forceExpAbs (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 HasSource, Optional< MCDwarfLineStr > &LineStr) |
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). More... | |
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 *RangesSectionSymbol) |
static void | EmitGenDwarfRanges (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) |
|
static |
Definition at line 783 of file MCDwarf.cpp.
References llvm::MCStreamer::EmitULEB128IntValue().
Referenced by EmitGenDwarfAbbrev().
|
static |
Definition at line 306 of file MCDwarf.cpp.
References llvm::ISD::ABS, llvm::MCStreamer::EmitValue(), and forceExpAbs().
Referenced by llvm::MCDwarfLineTableHeader::Emit(), emitEncodingByte(), emitFDESymbol(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), EmitGenDwarfRanges(), and getCIEVersion().
|
inlinestatic |
Definition at line 151 of file MCDwarf.cpp.
References DWARF2_FLAG_BASIC_BLOCK, DWARF2_FLAG_EPILOGUE_BEGIN, DWARF2_FLAG_IS_STMT, DWARF2_FLAG_PROLOGUE_END, DWARF2_LINE_DEFAULT_IS_STMT, llvm::MCObjectStreamer::EmitDwarfAdvanceLineAddr(), llvm::MCStreamer::EmitIntValue(), llvm::MCStreamer::EmitULEB128IntValue(), llvm::MCStreamer::endSection(), llvm::MCContext::getAsmInfo(), llvm::MCAsmInfo::getCodePointerSize(), llvm::MCStreamer::getContext(), llvm::MCObjectFileInfo::getDwarfLineSection(), llvm::MCContext::getDwarfVersion(), llvm::MCContext::getObjectFileInfo(), llvm::getULEB128Size(), INT64_MAX, Size, and llvm::MCStreamer::SwitchSection().
Referenced by llvm::MCDwarfLineTable::EmitCU().
|
static |
Definition at line 1310 of file MCDwarf.cpp.
References llvm::MCDwarfFrameInfo::Begin, llvm::MCDwarfFrameInfo::CompactUnwindEncoding, Context, llvm::dwarf::DW_EH_PE_absptr, llvm::dwarf::DW_EH_PE_udata4, emitAbsValue(), llvm::MCStreamer::EmitIntValue(), llvm::MCDwarfFrameInfo::End, llvm::MCObjectFileInfo::getCompactUnwindDwarfEHFrameOnly(), getDataAlignmentFactor(), llvm::MCObjectFileInfo::getFDEEncoding(), llvm::MCCFIInstruction::getLabel(), llvm::MCContext::getObjectFileInfo(), llvm::MCCFIInstruction::getOffset(), llvm::MCCFIInstruction::getOperation(), llvm::MCCFIInstruction::getRegister(), llvm::MCCFIInstruction::getRegister2(), getSizeForEncoding(), llvm::MCCFIInstruction::getValues(), llvm::MCSymbol::isDefined(), llvm_unreachable, llvm::MCDwarfFrameInfo::Lsda, llvm::MCDwarfFrameInfo::LsdaEncoding, MakeStartMinusEndExpr(), MRI, llvm::MCCFIInstruction::OpAdjustCfaOffset, llvm::MCCFIInstruction::OpDefCfa, llvm::MCCFIInstruction::OpDefCfaOffset, llvm::MCCFIInstruction::OpDefCfaRegister, llvm::MCCFIInstruction::OpEscape, llvm::MCCFIInstruction::OpGnuArgsSize, llvm::MCCFIInstruction::OpNegateRAState, llvm::MCCFIInstruction::OpOffset, llvm::MCCFIInstruction::OpRegister, llvm::MCCFIInstruction::OpRelOffset, llvm::MCCFIInstruction::OpRememberState, llvm::MCCFIInstruction::OpRestore, llvm::MCCFIInstruction::OpRestoreState, llvm::MCCFIInstruction::OpSameValue, llvm::MCCFIInstruction::OpUndefined, llvm::MCCFIInstruction::OpWindowSave, llvm::MCDwarfFrameInfo::Personality, Reg, and Size.
Referenced by getCIEVersion().
|
static |
Definition at line 1260 of file MCDwarf.cpp.
References llvm::MCAsmInfo::doDwarfFDESymbolsUseAbsDiff(), emitAbsValue(), llvm::MCStreamer::EmitValue(), llvm::MCContext::getAsmInfo(), llvm::MCStreamer::getContext(), llvm::MCAsmInfo::getExprForFDESymbol(), getSizeForEncoding(), and llvm::size().
Referenced by getCIEVersion().
|
static |
Definition at line 790 of file MCDwarf.cpp.
References llvm::dwarf::DW_CHILDREN_no, llvm::dwarf::DW_CHILDREN_yes, EmitAbbrev(), llvm::MCStreamer::EmitIntValue(), llvm::MCStreamer::EmitULEB128IntValue(), llvm::StringRef::empty(), llvm::MCContext::getCompilationDir(), llvm::MCStreamer::getContext(), llvm::MCObjectFileInfo::getDwarfAbbrevSection(), llvm::MCContext::getDwarfDebugFlags(), llvm::MCContext::getDwarfVersion(), llvm::MCContext::getGenDwarfSectionSyms(), llvm::MCContext::getObjectFileInfo(), and llvm::MCStreamer::SwitchSection().
Referenced by llvm::MCGenDwarfInfo::Emit().
|
static |
Definition at line 845 of file MCDwarf.cpp.
References assert(), llvm::MCSymbolRefExpr::create(), emitAbsValue(), llvm::MCStreamer::EmitIntValue(), llvm::MCStreamer::EmitSymbolValue(), llvm::MCStreamer::EmitValue(), llvm::MCContext::getAsmInfo(), llvm::MCAsmInfo::getCodePointerSize(), llvm::MCStreamer::getContext(), llvm::MCObjectFileInfo::getDwarfARangesSection(), llvm::MCContext::getGenDwarfSectionSyms(), llvm::MCContext::getObjectFileInfo(), MakeStartMinusEndExpr(), llvm::MCAsmInfo::needsDwarfSectionOffsetDirective(), Size, llvm::MCStreamer::SwitchSection(), and llvm::MCSymbolRefExpr::VK_None.
Referenced by llvm::MCGenDwarfInfo::Emit().
|
static |
Definition at line 916 of file MCDwarf.cpp.
References assert(), llvm::MCContext::createTempSymbol(), emitAbsValue(), llvm::MCStreamer::EmitIntValue(), llvm::MCStreamer::EmitLabel(), llvm::MCStreamer::EmitSymbolValue(), llvm::MCStreamer::EmitULEB128IntValue(), llvm::MCContext::getAsmInfo(), llvm::MCAsmInfo::getCodePointerSize(), llvm::MCStreamer::getContext(), llvm::MCObjectFileInfo::getDwarfInfoSection(), llvm::MCContext::getDwarfVersion(), llvm::MCContext::getGenDwarfSectionSyms(), llvm::MCContext::getObjectFileInfo(), MakeStartMinusEndExpr(), llvm::MCAsmInfo::needsDwarfSectionOffsetDirective(), and llvm::MCStreamer::SwitchSection().
Referenced by llvm::MCGenDwarfInfo::Emit().
|
static |
Definition at line 1084 of file MCDwarf.cpp.
References assert(), llvm::MCSymbolRefExpr::create(), emitAbsValue(), llvm::MCStreamer::emitFill(), llvm::MCStreamer::EmitIntValue(), llvm::MCStreamer::EmitValue(), llvm::MCContext::getAsmInfo(), llvm::MCAsmInfo::getCodePointerSize(), llvm::MCStreamer::getContext(), llvm::MCObjectFileInfo::getDwarfRangesSection(), llvm::MCContext::getGenDwarfSectionSyms(), llvm::MCContext::getObjectFileInfo(), MakeStartMinusEndExpr(), llvm::COFF::SectionSize, llvm::MCStreamer::SwitchSection(), and llvm::MCSymbolRefExpr::VK_None.
Referenced by llvm::MCGenDwarfInfo::Emit().
|
static |
Definition at line 353 of file MCDwarf.cpp.
References assert(), llvm::MD5::MD5Result::Bytes, llvm::MCDwarfFile::Checksum, llvm::MCDwarfFile::DirIndex, llvm::MCStreamer::EmitBinaryData(), llvm::MCStreamer::EmitBytes(), llvm::MCStreamer::EmitIntValue(), llvm::MCDwarfLineStr::emitRef(), llvm::MCStreamer::EmitULEB128IntValue(), llvm::StringRef::empty(), llvm::MCDwarfFile::Name, and llvm::MCDwarfFile::Source.
|
static |
Definition at line 1274 of file MCDwarf.cpp.
References llvm::MCStreamer::EmitValue(), F(), llvm::MCContext::getAsmInfo(), llvm::MCStreamer::getContext(), llvm::MCAsmInfo::getExprForPersonalitySymbol(), getSizeForEncoding(), and llvm::size().
Referenced by getCIEVersion().
|
static |
Definition at line 295 of file MCDwarf.cpp.
References llvm::ISD::ABS, assert(), Context, llvm::MCSymbolRefExpr::create(), llvm::MCContext::createTempSymbol(), llvm::MCStreamer::EmitAssignment(), llvm::MCContext::getAsmInfo(), llvm::MCStreamer::getContext(), and llvm::MCAsmInfo::hasAggressiveSymbolFolding().
Referenced by emitAbsValue().
Definition at line 1530 of file MCDwarf.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, assert(), llvm::MCDwarfFrameInfo::Begin, llvm::MCContext::createTempSymbol(), llvm::MCAsmInfo::doesDwarfUseRelocationsAcrossSections(), llvm::dwarf::DW_EH_PE_absptr, emitAbsValue(), emitEncodingByte(), emitFDESymbol(), EmitPersonality(), llvm::MCDwarfFrameInfo::End, llvm::MCContext::getAsmInfo(), llvm::MCAsmInfo::getCodePointerSize(), getDataAlignmentFactor(), llvm::MCRegisterInfo::getDwarfRegNum(), llvm::MCContext::getDwarfVersion(), llvm::MCObjectFileInfo::getFDEEncoding(), llvm::MCAsmInfo::getInitialFrameState(), llvm::MCAsmInfo::getMinInstAlignment(), llvm::MCContext::getObjectFileInfo(), llvm::MCRegisterInfo::getRARegister(), llvm::MCContext::getRegisterInfo(), getSizeForEncoding(), llvm::MCDwarfFrameInfo::Instructions, llvm::MCDwarfFrameInfo::IsBKeyFrame, llvm::MCDwarfFrameInfo::IsSignalFrame, llvm::MCDwarfFrameInfo::IsSimple, llvm_unreachable, llvm::MCDwarfFrameInfo::Lsda, llvm::MCDwarfFrameInfo::LsdaEncoding, MakeStartMinusEndExpr(), MRI, llvm::MCDwarfFrameInfo::Personality, llvm::MCDwarfFrameInfo::PersonalityEncoding, and llvm::MCDwarfFrameInfo::RAReg.
|
static |
Definition at line 1229 of file MCDwarf.cpp.
References llvm::MCContext::getAsmInfo(), llvm::MCAsmInfo::getCalleeSaveStackSlotSize(), llvm::MCStreamer::getContext(), llvm::MCAsmInfo::isStackGrowthDirectionUp(), and llvm::size().
Referenced by emitEncodingByte(), and getCIEVersion().
|
static |
Definition at line 1239 of file MCDwarf.cpp.
References llvm::dwarf::DW_EH_PE_absptr, llvm::dwarf::DW_EH_PE_sdata2, llvm::dwarf::DW_EH_PE_sdata4, llvm::dwarf::DW_EH_PE_sdata8, llvm::dwarf::DW_EH_PE_signed, llvm::dwarf::DW_EH_PE_udata2, llvm::dwarf::DW_EH_PE_udata4, llvm::dwarf::DW_EH_PE_udata8, llvm::format(), llvm::MCContext::getAsmInfo(), llvm::MCAsmInfo::getCodePointerSize(), llvm::MCStreamer::getContext(), and llvm_unreachable.
Referenced by emitEncodingByte(), emitFDESymbol(), EmitPersonality(), and getCIEVersion().
|
inlinestatic |
Definition at line 116 of file MCDwarf.cpp.
Referenced by llvm::MCDwarfLineTableHeader::Emit(), emitEncodingByte(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), EmitGenDwarfRanges(), and getCIEVersion().
|
inlinestatic |
Definition at line 138 of file MCDwarf.cpp.
Referenced by llvm::MCDwarfLineStr::emitRef().
|
inlinestatic |
Definition at line 72 of file MCDwarf.cpp.
References llvm::MCContext::getAsmInfo(), and llvm::MCAsmInfo::getMinInstAlignment().
Referenced by llvm::MCDwarfLineAddr::Encode(), and llvm::MCDwarfFrameEmitter::EncodeAdvanceLoc().
|
static |
Given a special op, return the address skip amount (in units of DWARF2_LINE_MIN_INSN_LENGTH).
Definition at line 644 of file MCDwarf.cpp.
References llvm::MCDwarfLineTableParams::DWARF2LineOpcodeBase, and llvm::MCDwarfLineTableParams::DWARF2LineRange.
Referenced by llvm::MCDwarfLineAddr::Encode().