Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
DebugHandlerBase.cpp
Go to the documentation of this file.
1//===-- llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp -------*- C++ -*--===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Common functionality for different debug information format backends.
10// LLVM currently supports DWARF and CodeView.
11//
12//===----------------------------------------------------------------------===//
13
14#include "llvm/CodeGen/DebugHandlerBase.h"
15#include "llvm/CodeGen/AsmPrinter.h"
16#include "llvm/CodeGen/MachineFunction.h"
17#include "llvm/CodeGen/MachineInstr.h"
18#include "llvm/CodeGen/MachineModuleInfo.h"
19#include "llvm/CodeGen/TargetSubtargetInfo.h"
20#include "llvm/IR/DebugInfo.h"
21#include "llvm/IR/Module.h"
22#include "llvm/MC/MCStreamer.h"
23#include "llvm/Support/CommandLine.h"
24
25using namespacellvm;
26
27#define DEBUG_TYPE "dwarfdebug"
28
29/// If true, we drop variable location ranges which exist entirely outside the
30/// variable's lexical scope instruction ranges.
31staticcl::opt<bool>TrimVarLocs("trim-var-locs",cl::Hidden,cl::init(true));
32
33std::optional<DbgVariableLocation>
34DbgVariableLocation::extractFromMachineInstruction(
35constMachineInstr &Instruction) {
36DbgVariableLocation Location;
37// Variables calculated from multiple locations can't be represented here.
38if (Instruction.getNumDebugOperands() != 1)
39return std::nullopt;
40if (!Instruction.getDebugOperand(0).isReg())
41return std::nullopt;
42 Location.Register =Instruction.getDebugOperand(0).getReg();
43 Location.FragmentInfo.reset();
44// We only handle expressions generated by DIExpression::appendOffset,
45// which doesn't require a full stack machine.
46 int64_tOffset = 0;
47constDIExpression *DIExpr =Instruction.getDebugExpression();
48autoOp = DIExpr->expr_op_begin();
49// We can handle a DBG_VALUE_LIST iff it has exactly one location operand that
50// appears exactly once at the start of the expression.
51if (Instruction.isDebugValueList()) {
52if (Instruction.getNumDebugOperands() == 1 &&
53Op->getOp() ==dwarf::DW_OP_LLVM_arg)
54 ++Op;
55else
56return std::nullopt;
57 }
58while (Op != DIExpr->expr_op_end()) {
59switch (Op->getOp()) {
60case dwarf::DW_OP_constu: {
61intValue =Op->getArg(0);
62 ++Op;
63if (Op != DIExpr->expr_op_end()) {
64switch (Op->getOp()) {
65case dwarf::DW_OP_minus:
66Offset -=Value;
67break;
68case dwarf::DW_OP_plus:
69Offset +=Value;
70break;
71default:
72continue;
73 }
74 }
75 }break;
76case dwarf::DW_OP_plus_uconst:
77Offset +=Op->getArg(0);
78break;
79casedwarf::DW_OP_LLVM_fragment:
80 Location.FragmentInfo = {Op->getArg(1),Op->getArg(0)};
81break;
82case dwarf::DW_OP_deref:
83 Location.LoadChain.push_back(Offset);
84Offset = 0;
85break;
86default:
87return std::nullopt;
88 }
89 ++Op;
90 }
91
92// Do one final implicit DW_OP_deref if this was an indirect DBG_VALUE
93// instruction.
94// FIXME: Replace these with DIExpression.
95if (Instruction.isIndirectDebugValue())
96 Location.LoadChain.push_back(Offset);
97
98return Location;
99}
100
101DebugHandlerBase::DebugHandlerBase(AsmPrinter *A) : Asm(A), MMI(Asm->MMI) {}
102
103DebugHandlerBase::~DebugHandlerBase() =default;
104
105voidDebugHandlerBase::beginModule(Module *M) {
106if (M->debug_compile_units().empty())
107Asm =nullptr;
108}
109
110// Each LexicalScope has first instruction and last instruction to mark
111// beginning and end of a scope respectively. Create an inverse map that list
112// scopes starts (and ends) with an instruction. One instruction may start (or
113// end) multiple scopes. Ignore scopes that are not reachable.
114voidDebugHandlerBase::identifyScopeMarkers() {
115SmallVector<LexicalScope *, 4> WorkList;
116 WorkList.push_back(LScopes.getCurrentFunctionScope());
117while (!WorkList.empty()) {
118LexicalScope *S = WorkList.pop_back_val();
119
120constSmallVectorImpl<LexicalScope *> &Children = S->getChildren();
121if (!Children.empty())
122 WorkList.append(Children.begin(), Children.end());
123
124if (S->isAbstractScope())
125continue;
126
127for (constInsnRange &R : S->getRanges()) {
128assert(R.first &&"InsnRange does not have first instruction!");
129assert(R.second &&"InsnRange does not have second instruction!");
130requestLabelBeforeInsn(R.first);
131requestLabelAfterInsn(R.second);
132 }
133 }
134}
135
136// Return Label preceding the instruction.
137MCSymbol *DebugHandlerBase::getLabelBeforeInsn(constMachineInstr *MI) {
138MCSymbol *Label =LabelsBeforeInsn.lookup(MI);
139assert(Label &&"Didn't insert label before instruction");
140return Label;
141}
142
143// Return Label immediately following the instruction.
144MCSymbol *DebugHandlerBase::getLabelAfterInsn(constMachineInstr *MI) {
145returnLabelsAfterInsn.lookup(MI);
146}
147
148/// If this type is derived from a base type then return base type size.
149uint64_tDebugHandlerBase::getBaseTypeSize(constDIType *Ty) {
150assert(Ty);
151constDIDerivedType *DDTy = dyn_cast<DIDerivedType>(Ty);
152if (!DDTy)
153return Ty->getSizeInBits();
154
155unsignedTag = DDTy->getTag();
156
157if (Tag != dwarf::DW_TAG_member &&Tag != dwarf::DW_TAG_typedef &&
158Tag != dwarf::DW_TAG_const_type &&Tag != dwarf::DW_TAG_volatile_type &&
159Tag != dwarf::DW_TAG_restrict_type &&Tag != dwarf::DW_TAG_atomic_type &&
160Tag != dwarf::DW_TAG_immutable_type &&
161Tag != dwarf::DW_TAG_template_alias)
162return DDTy->getSizeInBits();
163
164DIType *BaseType = DDTy->getBaseType();
165
166if (!BaseType)
167return 0;
168
169// If this is a derived type, go ahead and get the base type, unless it's a
170// reference then it's just the size of the field. Pointer types have no need
171// of this since they're a different type of qualification on the type.
172if (BaseType->getTag() == dwarf::DW_TAG_reference_type ||
173BaseType->getTag() == dwarf::DW_TAG_rvalue_reference_type)
174return Ty->getSizeInBits();
175
176returngetBaseTypeSize(BaseType);
177}
178
179boolDebugHandlerBase::isUnsignedDIType(constDIType *Ty) {
180if (isa<DIStringType>(Ty)) {
181// Some transformations (e.g. instcombine) may decide to turn a Fortran
182// character object into an integer, and later ones (e.g. SROA) may
183// further inject a constant integer in a llvm.dbg.value call to track
184// the object's value. Here we trust the transformations are doing the
185// right thing, and treat the constant as unsigned to preserve that value
186// (i.e. avoid sign extension).
187returntrue;
188 }
189
190if (auto *CTy = dyn_cast<DICompositeType>(Ty)) {
191if (CTy->getTag() == dwarf::DW_TAG_enumeration_type) {
192if (!(Ty = CTy->getBaseType()))
193// FIXME: Enums without a fixed underlying type have unknown signedness
194// here, leading to incorrectly emitted constants.
195returnfalse;
196 }else
197// (Pieces of) aggregate types that get hacked apart by SROA may be
198// represented by a constant. Encode them as unsigned bytes.
199returntrue;
200 }
201
202if (auto *DTy = dyn_cast<DIDerivedType>(Ty)) {
203dwarf::TagT = (dwarf::Tag)Ty->getTag();
204// Encode pointer constants as unsigned bytes. This is used at least for
205// null pointer constant emission.
206// FIXME: reference and rvalue_reference /probably/ shouldn't be allowed
207// here, but accept them for now due to a bug in SROA producing bogus
208// dbg.values.
209if (T == dwarf::DW_TAG_pointer_type ||
210T == dwarf::DW_TAG_ptr_to_member_type ||
211T == dwarf::DW_TAG_reference_type ||
212T == dwarf::DW_TAG_rvalue_reference_type)
213returntrue;
214assert(T == dwarf::DW_TAG_typedef ||T == dwarf::DW_TAG_const_type ||
215T == dwarf::DW_TAG_volatile_type ||
216T == dwarf::DW_TAG_restrict_type ||T == dwarf::DW_TAG_atomic_type ||
217T == dwarf::DW_TAG_immutable_type ||
218T == dwarf::DW_TAG_template_alias);
219assert(DTy->getBaseType() &&"Expected valid base type");
220returnisUnsignedDIType(DTy->getBaseType());
221 }
222
223auto *BTy = cast<DIBasicType>(Ty);
224unsigned Encoding = BTy->getEncoding();
225assert((Encoding == dwarf::DW_ATE_unsigned ||
226 Encoding == dwarf::DW_ATE_unsigned_char ||
227 Encoding == dwarf::DW_ATE_signed ||
228 Encoding == dwarf::DW_ATE_signed_char ||
229 Encoding == dwarf::DW_ATE_float || Encoding == dwarf::DW_ATE_UTF ||
230 Encoding == dwarf::DW_ATE_boolean ||
231 Encoding == dwarf::DW_ATE_complex_float ||
232 Encoding == dwarf::DW_ATE_signed_fixed ||
233 Encoding == dwarf::DW_ATE_unsigned_fixed ||
234 (Ty->getTag() == dwarf::DW_TAG_unspecified_type &&
235 Ty->getName() =="decltype(nullptr)")) &&
236"Unsupported encoding");
237return Encoding == dwarf::DW_ATE_unsigned ||
238 Encoding == dwarf::DW_ATE_unsigned_char ||
239 Encoding == dwarf::DW_ATE_UTF || Encoding == dwarf::DW_ATE_boolean ||
240 Encoding == llvm::dwarf::DW_ATE_unsigned_fixed ||
241 Ty->getTag() == dwarf::DW_TAG_unspecified_type;
242}
243
244staticboolhasDebugInfo(constMachineFunction *MF) {
245auto *SP = MF->getFunction().getSubprogram();
246if (!SP)
247returnfalse;
248assert(SP->getUnit());
249auto EK = SP->getUnit()->getEmissionKind();
250if (EK ==DICompileUnit::NoDebug)
251returnfalse;
252returntrue;
253}
254
255voidDebugHandlerBase::beginFunction(constMachineFunction *MF) {
256PrevInstBB =nullptr;
257
258if (!Asm || !hasDebugInfo(MF)) {
259skippedNonDebugFunction();
260return;
261 }
262
263// Grab the lexical scopes for the function, if we don't have any of those
264// then we're not going to be able to do anything.
265LScopes.initialize(*MF);
266if (LScopes.empty()) {
267beginFunctionImpl(MF);
268return;
269 }
270
271// Make sure that each lexical scope will have a begin/end label.
272identifyScopeMarkers();
273
274// Calculate history for local variables.
275assert(DbgValues.empty() &&"DbgValues map wasn't cleaned!");
276assert(DbgLabels.empty() &&"DbgLabels map wasn't cleaned!");
277calculateDbgEntityHistory(MF,Asm->MF->getSubtarget().getRegisterInfo(),
278DbgValues,DbgLabels);
279 InstOrdering.initialize(*MF);
280if (TrimVarLocs)
281DbgValues.trimLocationRanges(*MF,LScopes, InstOrdering);
282LLVM_DEBUG(DbgValues.dump(MF->getName()));
283
284// Request labels for the full history.
285for (constauto &I :DbgValues) {
286constauto &Entries =I.second;
287if (Entries.empty())
288continue;
289
290auto IsDescribedByReg = [](constMachineInstr *MI) {
291returnany_of(MI->debug_operands(),
292 [](auto &MO) { return MO.isReg() && MO.getReg(); });
293 };
294
295// The first mention of a function argument gets the CurrentFnBegin label,
296// so arguments are visible when breaking at function entry.
297//
298// We do not change the label for values that are described by registers,
299// as that could place them above their defining instructions. We should
300// ideally not change the labels for constant debug values either, since
301// doing that violates the ranges that are calculated in the history map.
302// However, we currently do not emit debug values for constant arguments
303// directly at the start of the function, so this code is still useful.
304constDILocalVariable *DIVar =
305 Entries.front().getInstr()->getDebugVariable();
306if (DIVar->isParameter() &&
307getDISubprogram(DIVar->getScope())->describes(&MF->getFunction())) {
308if (!IsDescribedByReg(Entries.front().getInstr()))
309LabelsBeforeInsn[Entries.front().getInstr()] =Asm->getFunctionBegin();
310if (Entries.front().getInstr()->getDebugExpression()->isFragment()) {
311// Mark all non-overlapping initial fragments.
312for (constauto *I = Entries.begin();I != Entries.end(); ++I) {
313if (!I->isDbgValue())
314continue;
315constDIExpression *Fragment =I->getInstr()->getDebugExpression();
316if (std::any_of(Entries.begin(),I,
317 [&](DbgValueHistoryMap::Entry Pred) {
318 return Pred.isDbgValue() &&
319 Fragment->fragmentsOverlap(
320 Pred.getInstr()->getDebugExpression());
321 }))
322break;
323// The code that generates location lists for DWARF assumes that the
324// entries' start labels are monotonically increasing, and since we
325// don't change the label for fragments that are described by
326// registers, we must bail out when encountering such a fragment.
327if (IsDescribedByReg(I->getInstr()))
328break;
329LabelsBeforeInsn[I->getInstr()] =Asm->getFunctionBegin();
330 }
331 }
332 }
333
334for (constauto &Entry : Entries) {
335if (Entry.isDbgValue())
336requestLabelBeforeInsn(Entry.getInstr());
337else
338requestLabelAfterInsn(Entry.getInstr());
339 }
340 }
341
342// Ensure there is a symbol before DBG_LABEL.
343for (constauto &I :DbgLabels) {
344constMachineInstr *MI =I.second;
345requestLabelBeforeInsn(MI);
346 }
347
348PrevInstLoc =DebugLoc();
349PrevLabel =Asm->getFunctionBegin();
350beginFunctionImpl(MF);
351}
352
353voidDebugHandlerBase::beginInstruction(constMachineInstr *MI) {
354if (!Asm || !Asm->hasDebugInfo())
355return;
356
357assert(CurMI ==nullptr);
358CurMI =MI;
359
360// Insert labels where requested.
361DenseMap<const MachineInstr *, MCSymbol *>::iteratorI =
362LabelsBeforeInsn.find(MI);
363
364// No label needed.
365if (I ==LabelsBeforeInsn.end())
366return;
367
368// Label already assigned.
369if (I->second)
370return;
371
372if (!PrevLabel) {
373PrevLabel =MMI->getContext().createTempSymbol();
374Asm->OutStreamer->emitLabel(PrevLabel);
375 }
376I->second =PrevLabel;
377}
378
379voidDebugHandlerBase::endInstruction() {
380if (!Asm || !Asm->hasDebugInfo())
381return;
382
383assert(CurMI !=nullptr);
384// Don't create a new label after DBG_VALUE and other instructions that don't
385// generate code.
386if (!CurMI->isMetaInstruction()) {
387PrevLabel =nullptr;
388PrevInstBB =CurMI->getParent();
389 }
390
391DenseMap<const MachineInstr *, MCSymbol *>::iteratorI =
392LabelsAfterInsn.find(CurMI);
393
394// No label needed or label already assigned.
395if (I ==LabelsAfterInsn.end() ||I->second) {
396CurMI =nullptr;
397return;
398 }
399
400// We need a label after this instruction. With basic block sections, just
401// use the end symbol of the section if this is the last instruction of the
402// section. This reduces the need for an additional label and also helps
403// merging ranges.
404if (CurMI->getParent()->isEndSection() &&CurMI->getNextNode() ==nullptr) {
405PrevLabel =CurMI->getParent()->getEndSymbol();
406 }elseif (!PrevLabel) {
407PrevLabel =MMI->getContext().createTempSymbol();
408Asm->OutStreamer->emitLabel(PrevLabel);
409 }
410I->second =PrevLabel;
411CurMI =nullptr;
412}
413
414voidDebugHandlerBase::endFunction(constMachineFunction *MF) {
415if (Asm &&hasDebugInfo(MF))
416endFunctionImpl(MF);
417DbgValues.clear();
418DbgLabels.clear();
419LabelsBeforeInsn.clear();
420LabelsAfterInsn.clear();
421 InstOrdering.clear();
422}
423
424voidDebugHandlerBase::beginBasicBlockSection(constMachineBasicBlock &MBB) {
425EpilogBeginBlock =nullptr;
426if (!MBB.isEntryBlock())
427PrevLabel =MBB.getSymbol();
428}
429
430voidDebugHandlerBase::endBasicBlockSection(constMachineBasicBlock &MBB) {
431PrevLabel =nullptr;
432}
MBB
MachineBasicBlock & MBB
Definition:ARMSLSHardening.cpp:71
AsmPrinter.h
A
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
CommandLine.h
TrimVarLocs
static cl::opt< bool > TrimVarLocs("trim-var-locs", cl::Hidden, cl::init(true))
If true, we drop variable location ranges which exist entirely outside the variable's lexical scope i...
hasDebugInfo
static bool hasDebugInfo(const MachineFunction *MF)
Definition:DebugHandlerBase.cpp:244
DebugHandlerBase.h
LLVM_DEBUG
#define LLVM_DEBUG(...)
Definition:Debug.h:106
MI
IRTranslator LLVM IR MI
Definition:IRTranslator.cpp:112
Module.h
Module.h This file contains the declarations for the Module class.
MCStreamer.h
I
#define I(x, y, z)
Definition:MD5.cpp:58
MachineFunction.h
MachineInstr.h
MachineModuleInfo.h
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
TargetSubtargetInfo.h
BaseType
T
llvm::AsmPrinter
This class is intended to be used as a driving class for all asm writers.
Definition:AsmPrinter.h:87
llvm::AsmPrinter::getFunctionBegin
MCSymbol * getFunctionBegin() const
Definition:AsmPrinter.h:269
llvm::AsmPrinter::MF
MachineFunction * MF
The current machine function.
Definition:AsmPrinter.h:105
llvm::AsmPrinter::hasDebugInfo
bool hasDebugInfo() const
Returns true if valid debug info is present.
Definition:AsmPrinter.h:440
llvm::AsmPrinter::OutStreamer
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
Definition:AsmPrinter.h:102
llvm::DICompileUnit::NoDebug
@ NoDebug
Definition:DebugInfoMetadata.h:1475
llvm::DIDerivedType
Derived types.
Definition:DebugInfoMetadata.h:997
llvm::DIExpression
DWARF expression.
Definition:DebugInfoMetadata.h:2763
llvm::DIExpression::expr_op_begin
expr_op_iterator expr_op_begin() const
Visit the elements via ExprOperand wrappers.
Definition:DebugInfoMetadata.h:2904
llvm::DIExpression::expr_op_end
expr_op_iterator expr_op_end() const
Definition:DebugInfoMetadata.h:2907
llvm::DILocalVariable
Local variable.
Definition:DebugInfoMetadata.h:3460
llvm::DILocalVariable::getScope
DILocalScope * getScope() const
Get the local scope for this variable.
Definition:DebugInfoMetadata.h:3518
llvm::DILocalVariable::isParameter
bool isParameter() const
Definition:DebugInfoMetadata.h:3522
llvm::DINode::getTag
dwarf::Tag getTag() const
Definition:DebugInfoMetadata.cpp:288
llvm::DIType
Base class for types.
Definition:DebugInfoMetadata.h:710
llvm::DIType::getName
StringRef getName() const
Definition:DebugInfoMetadata.h:763
llvm::DIType::getSizeInBits
uint64_t getSizeInBits() const
Definition:DebugInfoMetadata.h:755
llvm::DWARFExpression::Operation
This class represents an Operation in the Expression.
Definition:DWARFExpression.h:32
llvm::DbgLabelInstrMap::empty
bool empty() const
Definition:DbgEntityHistoryCalculator.h:143
llvm::DbgLabelInstrMap::clear
void clear()
Definition:DbgEntityHistoryCalculator.h:144
llvm::DbgValueHistoryMap::Entry
Specifies a change in a variable's debug value history.
Definition:DbgEntityHistoryCalculator.h:72
llvm::DbgValueHistoryMap::trimLocationRanges
void trimLocationRanges(const MachineFunction &MF, LexicalScopes &LScopes, const InstructionOrdering &Ordering)
Drop location ranges which exist entirely outside each variable's scope.
Definition:DbgEntityHistoryCalculator.cpp:129
llvm::DbgValueHistoryMap::clear
void clear()
Definition:DbgEntityHistoryCalculator.h:120
llvm::DbgValueHistoryMap::empty
bool empty() const
Definition:DbgEntityHistoryCalculator.h:119
llvm::DbgValueHistoryMap::dump
LLVM_DUMP_METHOD void dump(StringRef FuncName) const
Definition:DbgEntityHistoryCalculator.cpp:565
llvm::DebugHandlerBase::isUnsignedDIType
static bool isUnsignedDIType(const DIType *Ty)
Return true if type encoding is unsigned.
Definition:DebugHandlerBase.cpp:179
llvm::DebugHandlerBase::CurMI
const MachineInstr * CurMI
If nonnull, stores the current machine instruction we're processing.
Definition:DebugHandlerBase.h:79
llvm::DebugHandlerBase::Asm
AsmPrinter * Asm
Target of debug info emission.
Definition:DebugHandlerBase.h:58
llvm::DebugHandlerBase::endFunctionImpl
virtual void endFunctionImpl(const MachineFunction *MF)=0
llvm::DebugHandlerBase::getLabelBeforeInsn
MCSymbol * getLabelBeforeInsn(const MachineInstr *MI)
Return Label preceding the instruction.
Definition:DebugHandlerBase.cpp:137
llvm::DebugHandlerBase::MMI
MachineModuleInfo * MMI
Collected machine module information.
Definition:DebugHandlerBase.h:61
llvm::DebugHandlerBase::endBasicBlockSection
void endBasicBlockSection(const MachineBasicBlock &MBB) override
Process the end of a basic-block-section within a function.
Definition:DebugHandlerBase.cpp:430
llvm::DebugHandlerBase::identifyScopeMarkers
void identifyScopeMarkers()
Indentify instructions that are marking the beginning of or ending of a scope.
Definition:DebugHandlerBase.cpp:114
llvm::DebugHandlerBase::skippedNonDebugFunction
virtual void skippedNonDebugFunction()
Definition:DebugHandlerBase.h:114
llvm::DebugHandlerBase::endFunction
void endFunction(const MachineFunction *MF) override
Gather post-function debug information.
Definition:DebugHandlerBase.cpp:414
llvm::DebugHandlerBase::PrevLabel
MCSymbol * PrevLabel
Definition:DebugHandlerBase.h:68
llvm::DebugHandlerBase::PrevInstLoc
DebugLoc PrevInstLoc
Previous instruction's location information.
Definition:DebugHandlerBase.h:67
llvm::DebugHandlerBase::beginFunction
void beginFunction(const MachineFunction *MF) override
Gather pre-function debug information.
Definition:DebugHandlerBase.cpp:255
llvm::DebugHandlerBase::endInstruction
void endInstruction() override
Process end of an instruction.
Definition:DebugHandlerBase.cpp:379
llvm::DebugHandlerBase::~DebugHandlerBase
virtual ~DebugHandlerBase() override
llvm::DebugHandlerBase::getLabelAfterInsn
MCSymbol * getLabelAfterInsn(const MachineInstr *MI)
Return Label immediately following the instruction.
Definition:DebugHandlerBase.cpp:144
llvm::DebugHandlerBase::DebugHandlerBase
DebugHandlerBase(AsmPrinter *A)
Definition:DebugHandlerBase.cpp:101
llvm::DebugHandlerBase::beginInstruction
void beginInstruction(const MachineInstr *MI) override
Process beginning of an instruction.
Definition:DebugHandlerBase.cpp:353
llvm::DebugHandlerBase::PrevInstBB
const MachineBasicBlock * PrevInstBB
Definition:DebugHandlerBase.h:69
llvm::DebugHandlerBase::beginFunctionImpl
virtual void beginFunctionImpl(const MachineFunction *MF)=0
llvm::DebugHandlerBase::requestLabelAfterInsn
void requestLabelAfterInsn(const MachineInstr *MI)
Ensure that a label will be emitted after MI.
Definition:DebugHandlerBase.h:108
llvm::DebugHandlerBase::beginBasicBlockSection
void beginBasicBlockSection(const MachineBasicBlock &MBB) override
Process the beginning of a new basic-block-section within a function.
Definition:DebugHandlerBase.cpp:424
llvm::DebugHandlerBase::DbgValues
DbgValueHistoryMap DbgValues
History of DBG_VALUE and clobber instructions for each user variable.
Definition:DebugHandlerBase.h:85
llvm::DebugHandlerBase::DbgLabels
DbgLabelInstrMap DbgLabels
Mapping of inlined labels and DBG_LABEL machine instruction.
Definition:DebugHandlerBase.h:88
llvm::DebugHandlerBase::LabelsBeforeInsn
DenseMap< const MachineInstr *, MCSymbol * > LabelsBeforeInsn
Maps instruction with label emitted before instruction.
Definition:DebugHandlerBase.h:93
llvm::DebugHandlerBase::beginModule
void beginModule(Module *M) override
Definition:DebugHandlerBase.cpp:105
llvm::DebugHandlerBase::LabelsAfterInsn
DenseMap< const MachineInstr *, MCSymbol * > LabelsAfterInsn
Maps instruction with label emitted after instruction.
Definition:DebugHandlerBase.h:96
llvm::DebugHandlerBase::requestLabelBeforeInsn
void requestLabelBeforeInsn(const MachineInstr *MI)
Ensure that a label will be emitted before MI.
Definition:DebugHandlerBase.h:103
llvm::DebugHandlerBase::EpilogBeginBlock
const MachineBasicBlock * EpilogBeginBlock
This block includes epilogue instructions.
Definition:DebugHandlerBase.h:76
llvm::DebugHandlerBase::LScopes
LexicalScopes LScopes
Definition:DebugHandlerBase.h:81
llvm::DebugHandlerBase::getBaseTypeSize
static uint64_t getBaseTypeSize(const DIType *Ty)
If this type is derived from a base type then return base type size.
Definition:DebugHandlerBase.cpp:149
llvm::DebugLoc
A debug info location.
Definition:DebugLoc.h:33
llvm::DenseMapIterator
Definition:DenseMap.h:1189
llvm::Function::getSubprogram
DISubprogram * getSubprogram() const
Get the attached subprogram.
Definition:Metadata.cpp:1874
llvm::InstructionOrdering::clear
void clear()
Definition:DbgEntityHistoryCalculator.h:33
llvm::InstructionOrdering::initialize
void initialize(const MachineFunction &MF)
Definition:DbgEntityHistoryCalculator.cpp:39
llvm::Instruction
Definition:Instruction.h:68
llvm::LexicalScope
LexicalScope - This class is used to track scope information.
Definition:LexicalScopes.h:44
llvm::LexicalScope::getChildren
SmallVectorImpl< LexicalScope * > & getChildren()
Definition:LexicalScopes.h:65
llvm::LexicalScope::getRanges
SmallVectorImpl< InsnRange > & getRanges()
Definition:LexicalScopes.h:66
llvm::LexicalScope::isAbstractScope
bool isAbstractScope() const
Definition:LexicalScopes.h:64
llvm::LexicalScopes::initialize
void initialize(const MachineFunction &)
initialize - Scan machine function and constuct lexical scope nest, resets the instance if necessary.
Definition:LexicalScopes.cpp:51
llvm::LexicalScopes::empty
bool empty()
empty - Return true if there is any lexical scope information available.
Definition:LexicalScopes.h:153
llvm::LexicalScopes::getCurrentFunctionScope
LexicalScope * getCurrentFunctionScope() const
getCurrentFunctionScope - Return lexical scope for the current function.
Definition:LexicalScopes.h:156
llvm::MCContext::createTempSymbol
MCSymbol * createTempSymbol()
Create a temporary symbol with a unique name.
Definition:MCContext.cpp:345
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition:MCSymbol.h:41
llvm::MachineBasicBlock
Definition:MachineBasicBlock.h:125
llvm::MachineBasicBlock::getSymbol
MCSymbol * getSymbol() const
Return the MCSymbol for this basic block.
Definition:MachineBasicBlock.cpp:63
llvm::MachineBasicBlock::getEndSymbol
MCSymbol * getEndSymbol() const
Returns the MCSymbol marking the end of this basic block.
Definition:MachineBasicBlock.cpp:106
llvm::MachineBasicBlock::isEntryBlock
bool isEntryBlock() const
Returns true if this is the entry block of the function.
Definition:MachineBasicBlock.cpp:296
llvm::MachineBasicBlock::isEndSection
bool isEndSection() const
Returns true if this block ends any section.
Definition:MachineBasicBlock.h:675
llvm::MachineFunction
Definition:MachineFunction.h:267
llvm::MachineFunction::getSubtarget
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Definition:MachineFunction.h:733
llvm::MachineFunction::getName
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
Definition:MachineFunction.cpp:645
llvm::MachineFunction::getFunction
Function & getFunction()
Return the LLVM function that this machine code represents.
Definition:MachineFunction.h:704
llvm::MachineInstr
Representation of each machine instruction.
Definition:MachineInstr.h:71
llvm::MachineInstr::getParent
const MachineBasicBlock * getParent() const
Definition:MachineInstr.h:349
llvm::MachineInstr::isMetaInstruction
bool isMetaInstruction(QueryType Type=IgnoreBundle) const
Return true if this instruction doesn't produce any output in the form of executable instructions.
Definition:MachineInstr.h:944
llvm::MachineModuleInfo::getContext
const MCContext & getContext() const
Definition:MachineModuleInfo.h:125
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition:Module.h:65
llvm::SmallVectorBase::empty
bool empty() const
Definition:SmallVector.h:81
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition:SmallVector.h:573
llvm::SmallVectorImpl::pop_back_val
T pop_back_val()
Definition:SmallVector.h:673
llvm::SmallVectorImpl::append
void append(ItTy in_start, ItTy in_end)
Add the specified range to the end of the SmallVector.
Definition:SmallVector.h:683
llvm::SmallVectorTemplateBase::push_back
void push_back(const T &Elt)
Definition:SmallVector.h:413
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition:SmallVector.h:1196
llvm::TargetSubtargetInfo::getRegisterInfo
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
Definition:TargetSubtargetInfo.h:129
llvm::Value
LLVM Value Representation.
Definition:Value.h:74
llvm::cl::opt
Definition:CommandLine.h:1423
llvm::ilist_node_with_parent::getNextNode
NodeTy * getNextNode()
Get the next node, or nullptr for the list tail.
Definition:ilist_node.h:353
uint64_t
DebugInfo.h
llvm::cl::Hidden
@ Hidden
Definition:CommandLine.h:137
llvm::cl::init
initializer< Ty > init(const Ty &Val)
Definition:CommandLine.h:443
llvm::dwarf::DW_OP_LLVM_fragment
@ DW_OP_LLVM_fragment
Only used in LLVM metadata.
Definition:Dwarf.h:142
llvm::dwarf::DW_OP_LLVM_arg
@ DW_OP_LLVM_arg
Only used in LLVM metadata.
Definition:Dwarf.h:147
llvm::dwarf::Tag
Tag
Definition:Dwarf.h:103
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:AddressRanges.h:18
llvm::Offset
@ Offset
Definition:DWP.cpp:480
llvm::calculateDbgEntityHistory
void calculateDbgEntityHistory(const MachineFunction *MF, const TargetRegisterInfo *TRI, DbgValueHistoryMap &DbgValues, DbgLabelInstrMap &DbgLabels)
Definition:DbgEntityHistoryCalculator.cpp:456
llvm::any_of
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
Definition:STLExtras.h:1746
llvm::Op
DWARFExpression::Operation Op
Definition:DWARFExpression.cpp:22
llvm::HighlightColor::Tag
@ Tag
llvm::InsnRange
std::pair< const MachineInstr *, const MachineInstr * > InsnRange
InsnRange - This is used to track range of instructions with identical lexical scope.
Definition:LexicalScopes.h:39
llvm::getDISubprogram
DISubprogram * getDISubprogram(const MDNode *Scope)
Find subprogram that is enclosing this scope.
Definition:DebugInfo.cpp:169
llvm::DbgVariableLocation
Represents the location at which a variable is stored.
Definition:DebugHandlerBase.h:31
llvm::DbgVariableLocation::extractFromMachineInstruction
static std::optional< DbgVariableLocation > extractFromMachineInstruction(const MachineInstr &Instruction)
Extract a VariableLocation from a MachineInstr.
Definition:DebugHandlerBase.cpp:34

Generated on Fri Jul 18 2025 10:27:36 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp