003 File Manager
Current Path:
/usr/src/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter
usr
/
src
/
contrib
/
llvm-project
/
llvm
/
lib
/
CodeGen
/
AsmPrinter
/
📁
..
📄
ARMException.cpp
(4.45 KB)
📄
AccelTable.cpp
(24.07 KB)
📄
AddressPool.cpp
(2.61 KB)
📄
AddressPool.h
(1.93 KB)
📄
AsmPrinter.cpp
(123.3 KB)
📄
AsmPrinterDwarf.cpp
(9.88 KB)
📄
AsmPrinterInlineAsm.cpp
(25.75 KB)
📄
ByteStreamer.h
(3.93 KB)
📄
CodeViewDebug.cpp
(115.03 KB)
📄
CodeViewDebug.h
(17.9 KB)
📄
DIE.cpp
(25.69 KB)
📄
DIEHash.cpp
(14.17 KB)
📄
DIEHash.h
(3.37 KB)
📄
DIEHashAttributes.def
(2.02 KB)
📄
DbgEntityHistoryCalculator.cpp
(14.88 KB)
📄
DebugHandlerBase.cpp
(10.8 KB)
📄
DebugLocEntry.h
(6.96 KB)
📄
DebugLocStream.cpp
(1.36 KB)
📄
DebugLocStream.h
(5.78 KB)
📄
DwarfCFIException.cpp
(6.1 KB)
📄
DwarfCompileUnit.cpp
(55.27 KB)
📄
DwarfCompileUnit.h
(13.61 KB)
📄
DwarfDebug.cpp
(128.56 KB)
📄
DwarfDebug.h
(27.39 KB)
📄
DwarfException.h
(3.23 KB)
📄
DwarfExpression.cpp
(21.36 KB)
📄
DwarfExpression.h
(15.03 KB)
📄
DwarfFile.cpp
(4.31 KB)
📄
DwarfFile.h
(5.86 KB)
📄
DwarfStringPool.cpp
(4.72 KB)
📄
DwarfStringPool.h
(2.07 KB)
📄
DwarfUnit.cpp
(64.61 KB)
📄
DwarfUnit.h
(14.34 KB)
📄
EHStreamer.cpp
(25.33 KB)
📄
EHStreamer.h
(5.66 KB)
📄
ErlangGCPrinter.cpp
(4.16 KB)
📄
OcamlGCPrinter.cpp
(6.38 KB)
📄
WasmException.cpp
(4.09 KB)
📄
WasmException.h
(1.32 KB)
📄
WinCFGuard.cpp
(3.62 KB)
📄
WinCFGuard.h
(1.77 KB)
📄
WinException.cpp
(50.88 KB)
📄
WinException.h
(4.1 KB)
Editing: AddressPool.cpp
//===- llvm/CodeGen/AddressPool.cpp - Dwarf Debug Framework ---------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "AddressPool.h" #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/IR/DataLayout.h" #include "llvm/MC/MCStreamer.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include <utility> using namespace llvm; unsigned AddressPool::getIndex(const MCSymbol *Sym, bool TLS) { HasBeenUsed = true; auto IterBool = Pool.insert(std::make_pair(Sym, AddressPoolEntry(Pool.size(), TLS))); return IterBool.first->second.Number; } MCSymbol *AddressPool::emitHeader(AsmPrinter &Asm, MCSection *Section) { static const uint8_t AddrSize = Asm.getDataLayout().getPointerSize(); StringRef Prefix = "debug_addr_"; MCSymbol *BeginLabel = Asm.createTempSymbol(Prefix + "start"); MCSymbol *EndLabel = Asm.createTempSymbol(Prefix + "end"); Asm.OutStreamer->AddComment("Length of contribution"); Asm.emitLabelDifference(EndLabel, BeginLabel, 4); // TODO: Support DWARF64 format. Asm.OutStreamer->emitLabel(BeginLabel); Asm.OutStreamer->AddComment("DWARF version number"); Asm.emitInt16(Asm.getDwarfVersion()); Asm.OutStreamer->AddComment("Address size"); Asm.emitInt8(AddrSize); Asm.OutStreamer->AddComment("Segment selector size"); Asm.emitInt8(0); // TODO: Support non-zero segment_selector_size. return EndLabel; } // Emit addresses into the section given. void AddressPool::emit(AsmPrinter &Asm, MCSection *AddrSection) { if (isEmpty()) return; // Start the dwarf addr section. Asm.OutStreamer->SwitchSection(AddrSection); MCSymbol *EndLabel = nullptr; if (Asm.getDwarfVersion() >= 5) EndLabel = emitHeader(Asm, AddrSection); // Define the symbol that marks the start of the contribution. // It is referenced via DW_AT_addr_base. Asm.OutStreamer->emitLabel(AddressTableBaseSym); // Order the address pool entries by ID SmallVector<const MCExpr *, 64> Entries(Pool.size()); for (const auto &I : Pool) Entries[I.second.Number] = I.second.TLS ? Asm.getObjFileLowering().getDebugThreadLocalSymbol(I.first) : MCSymbolRefExpr::create(I.first, Asm.OutContext); for (const MCExpr *Entry : Entries) Asm.OutStreamer->emitValue(Entry, Asm.getDataLayout().getPointerSize()); if (EndLabel) Asm.OutStreamer->emitLabel(EndLabel); }
Upload File
Create Folder