LLVM  15.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 
15 #include "llvm/ADT/Optional.h"
21 #include "llvm/IR/DebugInfo.h"
22 #include "llvm/MC/MCStreamer.h"
24 
25 using namespace llvm;
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.
31 static cl::opt<bool> TrimVarLocs("trim-var-locs", cl::Hidden, cl::init(true));
32 
35  const MachineInstr &Instruction) {
36  DbgVariableLocation Location;
37  // Variables calculated from multiple locations can't be represented here.
38  if (Instruction.getNumDebugOperands() != 1)
39  return None;
40  if (!Instruction.getDebugOperand(0).isReg())
41  return None;
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_t Offset = 0;
47  const DIExpression *DIExpr = Instruction.getDebugExpression();
48  auto Op = 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.
51  if (Instruction.isDebugValueList()) {
52  if (Instruction.getNumDebugOperands() == 1 &&
53  Op->getOp() == dwarf::DW_OP_LLVM_arg)
54  ++Op;
55  else
56  return None;
57  }
58  while (Op != DIExpr->expr_op_end()) {
59  switch (Op->getOp()) {
60  case dwarf::DW_OP_constu: {
61  int Value = Op->getArg(0);
62  ++Op;
63  if (Op != DIExpr->expr_op_end()) {
64  switch (Op->getOp()) {
65  case dwarf::DW_OP_minus:
66  Offset -= Value;
67  break;
68  case dwarf::DW_OP_plus:
69  Offset += Value;
70  break;
71  default:
72  continue;
73  }
74  }
75  } break;
76  case dwarf::DW_OP_plus_uconst:
77  Offset += Op->getArg(0);
78  break;
80  Location.FragmentInfo = {Op->getArg(1), Op->getArg(0)};
81  break;
82  case dwarf::DW_OP_deref:
83  Location.LoadChain.push_back(Offset);
84  Offset = 0;
85  break;
86  default:
87  return None;
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.
95  if (Instruction.isIndirectDebugValue())
96  Location.LoadChain.push_back(Offset);
97 
98  return Location;
99 }
100 
102 
104  if (M->debug_compile_units().empty())
105  Asm = nullptr;
106 }
107 
108 // Each LexicalScope has first instruction and last instruction to mark
109 // beginning and end of a scope respectively. Create an inverse map that list
110 // scopes starts (and ends) with an instruction. One instruction may start (or
111 // end) multiple scopes. Ignore scopes that are not reachable.
114  WorkList.push_back(LScopes.getCurrentFunctionScope());
115  while (!WorkList.empty()) {
116  LexicalScope *S = WorkList.pop_back_val();
117 
118  const SmallVectorImpl<LexicalScope *> &Children = S->getChildren();
119  if (!Children.empty())
120  WorkList.append(Children.begin(), Children.end());
121 
122  if (S->isAbstractScope())
123  continue;
124 
125  for (const InsnRange &R : S->getRanges()) {
126  assert(R.first && "InsnRange does not have first instruction!");
127  assert(R.second && "InsnRange does not have second instruction!");
128  requestLabelBeforeInsn(R.first);
129  requestLabelAfterInsn(R.second);
130  }
131  }
132 }
133 
134 // Return Label preceding the instruction.
136  MCSymbol *Label = LabelsBeforeInsn.lookup(MI);
137  assert(Label && "Didn't insert label before instruction");
138  return Label;
139 }
140 
141 // Return Label immediately following the instruction.
143  return LabelsAfterInsn.lookup(MI);
144 }
145 
146 /// If this type is derived from a base type then return base type size.
148  assert(Ty);
149  const DIDerivedType *DDTy = dyn_cast<DIDerivedType>(Ty);
150  if (!DDTy)
151  return Ty->getSizeInBits();
152 
153  unsigned Tag = DDTy->getTag();
154 
155  if (Tag != dwarf::DW_TAG_member && Tag != dwarf::DW_TAG_typedef &&
156  Tag != dwarf::DW_TAG_const_type && Tag != dwarf::DW_TAG_volatile_type &&
157  Tag != dwarf::DW_TAG_restrict_type && Tag != dwarf::DW_TAG_atomic_type &&
158  Tag != dwarf::DW_TAG_immutable_type)
159  return DDTy->getSizeInBits();
160 
161  DIType *BaseType = DDTy->getBaseType();
162 
163  if (!BaseType)
164  return 0;
165 
166  // If this is a derived type, go ahead and get the base type, unless it's a
167  // reference then it's just the size of the field. Pointer types have no need
168  // of this since they're a different type of qualification on the type.
169  if (BaseType->getTag() == dwarf::DW_TAG_reference_type ||
170  BaseType->getTag() == dwarf::DW_TAG_rvalue_reference_type)
171  return Ty->getSizeInBits();
172 
173  return getBaseTypeSize(BaseType);
174 }
175 
177  if (isa<DIStringType>(Ty)) {
178  // Some transformations (e.g. instcombine) may decide to turn a Fortran
179  // character object into an integer, and later ones (e.g. SROA) may
180  // further inject a constant integer in a llvm.dbg.value call to track
181  // the object's value. Here we trust the transformations are doing the
182  // right thing, and treat the constant as unsigned to preserve that value
183  // (i.e. avoid sign extension).
184  return true;
185  }
186 
187  if (auto *CTy = dyn_cast<DICompositeType>(Ty)) {
188  if (CTy->getTag() == dwarf::DW_TAG_enumeration_type) {
189  if (!(Ty = CTy->getBaseType()))
190  // FIXME: Enums without a fixed underlying type have unknown signedness
191  // here, leading to incorrectly emitted constants.
192  return false;
193  } else
194  // (Pieces of) aggregate types that get hacked apart by SROA may be
195  // represented by a constant. Encode them as unsigned bytes.
196  return true;
197  }
198 
199  if (auto *DTy = dyn_cast<DIDerivedType>(Ty)) {
200  dwarf::Tag T = (dwarf::Tag)Ty->getTag();
201  // Encode pointer constants as unsigned bytes. This is used at least for
202  // null pointer constant emission.
203  // FIXME: reference and rvalue_reference /probably/ shouldn't be allowed
204  // here, but accept them for now due to a bug in SROA producing bogus
205  // dbg.values.
206  if (T == dwarf::DW_TAG_pointer_type ||
207  T == dwarf::DW_TAG_ptr_to_member_type ||
208  T == dwarf::DW_TAG_reference_type ||
209  T == dwarf::DW_TAG_rvalue_reference_type)
210  return true;
211  assert(T == dwarf::DW_TAG_typedef || T == dwarf::DW_TAG_const_type ||
212  T == dwarf::DW_TAG_volatile_type ||
213  T == dwarf::DW_TAG_restrict_type || T == dwarf::DW_TAG_atomic_type ||
214  T == dwarf::DW_TAG_immutable_type);
215  assert(DTy->getBaseType() && "Expected valid base type");
216  return isUnsignedDIType(DTy->getBaseType());
217  }
218 
219  auto *BTy = cast<DIBasicType>(Ty);
220  unsigned Encoding = BTy->getEncoding();
221  assert((Encoding == dwarf::DW_ATE_unsigned ||
222  Encoding == dwarf::DW_ATE_unsigned_char ||
223  Encoding == dwarf::DW_ATE_signed ||
224  Encoding == dwarf::DW_ATE_signed_char ||
225  Encoding == dwarf::DW_ATE_float || Encoding == dwarf::DW_ATE_UTF ||
226  Encoding == dwarf::DW_ATE_boolean ||
227  (Ty->getTag() == dwarf::DW_TAG_unspecified_type &&
228  Ty->getName() == "decltype(nullptr)")) &&
229  "Unsupported encoding");
230  return Encoding == dwarf::DW_ATE_unsigned ||
231  Encoding == dwarf::DW_ATE_unsigned_char ||
232  Encoding == dwarf::DW_ATE_UTF || Encoding == dwarf::DW_ATE_boolean ||
233  Ty->getTag() == dwarf::DW_TAG_unspecified_type;
234 }
235 
236 static bool hasDebugInfo(const MachineModuleInfo *MMI,
237  const MachineFunction *MF) {
238  if (!MMI->hasDebugInfo())
239  return false;
240  auto *SP = MF->getFunction().getSubprogram();
241  if (!SP)
242  return false;
243  assert(SP->getUnit());
244  auto EK = SP->getUnit()->getEmissionKind();
245  if (EK == DICompileUnit::NoDebug)
246  return false;
247  return true;
248 }
249 
251  PrevInstBB = nullptr;
252 
253  if (!Asm || !hasDebugInfo(MMI, MF)) {
255  return;
256  }
257 
258  // Grab the lexical scopes for the function, if we don't have any of those
259  // then we're not going to be able to do anything.
260  LScopes.initialize(*MF);
261  if (LScopes.empty()) {
262  beginFunctionImpl(MF);
263  return;
264  }
265 
266  // Make sure that each lexical scope will have a begin/end label.
268 
269  // Calculate history for local variables.
270  assert(DbgValues.empty() && "DbgValues map wasn't cleaned!");
271  assert(DbgLabels.empty() && "DbgLabels map wasn't cleaned!");
274  InstOrdering.initialize(*MF);
275  if (TrimVarLocs)
276  DbgValues.trimLocationRanges(*MF, LScopes, InstOrdering);
278 
279  // Request labels for the full history.
280  for (const auto &I : DbgValues) {
281  const auto &Entries = I.second;
282  if (Entries.empty())
283  continue;
284 
285  auto IsDescribedByReg = [](const MachineInstr *MI) {
286  return any_of(MI->debug_operands(),
287  [](auto &MO) { return MO.isReg() && MO.getReg(); });
288  };
289 
290  // The first mention of a function argument gets the CurrentFnBegin label,
291  // so arguments are visible when breaking at function entry.
292  //
293  // We do not change the label for values that are described by registers,
294  // as that could place them above their defining instructions. We should
295  // ideally not change the labels for constant debug values either, since
296  // doing that violates the ranges that are calculated in the history map.
297  // However, we currently do not emit debug values for constant arguments
298  // directly at the start of the function, so this code is still useful.
299  const DILocalVariable *DIVar =
300  Entries.front().getInstr()->getDebugVariable();
301  if (DIVar->isParameter() &&
302  getDISubprogram(DIVar->getScope())->describes(&MF->getFunction())) {
303  if (!IsDescribedByReg(Entries.front().getInstr()))
304  LabelsBeforeInsn[Entries.front().getInstr()] = Asm->getFunctionBegin();
305  if (Entries.front().getInstr()->getDebugExpression()->isFragment()) {
306  // Mark all non-overlapping initial fragments.
307  for (auto I = Entries.begin(); I != Entries.end(); ++I) {
308  if (!I->isDbgValue())
309  continue;
310  const DIExpression *Fragment = I->getInstr()->getDebugExpression();
311  if (std::any_of(Entries.begin(), I,
312  [&](DbgValueHistoryMap::Entry Pred) {
313  return Pred.isDbgValue() &&
314  Fragment->fragmentsOverlap(
315  Pred.getInstr()->getDebugExpression());
316  }))
317  break;
318  // The code that generates location lists for DWARF assumes that the
319  // entries' start labels are monotonically increasing, and since we
320  // don't change the label for fragments that are described by
321  // registers, we must bail out when encountering such a fragment.
322  if (IsDescribedByReg(I->getInstr()))
323  break;
324  LabelsBeforeInsn[I->getInstr()] = Asm->getFunctionBegin();
325  }
326  }
327  }
328 
329  for (const auto &Entry : Entries) {
330  if (Entry.isDbgValue())
331  requestLabelBeforeInsn(Entry.getInstr());
332  else
333  requestLabelAfterInsn(Entry.getInstr());
334  }
335  }
336 
337  // Ensure there is a symbol before DBG_LABEL.
338  for (const auto &I : DbgLabels) {
339  const MachineInstr *MI = I.second;
341  }
342 
343  PrevInstLoc = DebugLoc();
345  beginFunctionImpl(MF);
346 }
347 
349  if (!Asm || !MMI->hasDebugInfo())
350  return;
351 
352  assert(CurMI == nullptr);
353  CurMI = MI;
354 
355  // Insert labels where requested.
357  LabelsBeforeInsn.find(MI);
358 
359  // No label needed.
360  if (I == LabelsBeforeInsn.end())
361  return;
362 
363  // Label already assigned.
364  if (I->second)
365  return;
366 
367  if (!PrevLabel) {
369  Asm->OutStreamer->emitLabel(PrevLabel);
370  }
371  I->second = PrevLabel;
372 }
373 
375  if (!Asm || !MMI->hasDebugInfo())
376  return;
377 
378  assert(CurMI != nullptr);
379  // Don't create a new label after DBG_VALUE and other instructions that don't
380  // generate code.
381  if (!CurMI->isMetaInstruction()) {
382  PrevLabel = nullptr;
384  }
385 
387  LabelsAfterInsn.find(CurMI);
388 
389  // No label needed or label already assigned.
390  if (I == LabelsAfterInsn.end() || I->second) {
391  CurMI = nullptr;
392  return;
393  }
394 
395  // We need a label after this instruction. With basic block sections, just
396  // use the end symbol of the section if this is the last instruction of the
397  // section. This reduces the need for an additional label and also helps
398  // merging ranges.
399  if (CurMI->getParent()->isEndSection() && CurMI->getNextNode() == nullptr) {
401  } else if (!PrevLabel) {
403  Asm->OutStreamer->emitLabel(PrevLabel);
404  }
405  I->second = PrevLabel;
406  CurMI = nullptr;
407 }
408 
410  if (Asm && hasDebugInfo(MMI, MF))
411  endFunctionImpl(MF);
412  DbgValues.clear();
413  DbgLabels.clear();
414  LabelsBeforeInsn.clear();
415  LabelsAfterInsn.clear();
416  InstOrdering.clear();
417 }
418 
420  if (!MBB.isBeginSection())
421  return;
422 
423  PrevLabel = MBB.getSymbol();
424 }
425 
427  if (!MBB.isEndSection())
428  return;
429 
430  PrevLabel = nullptr;
431 }
llvm::DebugHandlerBase::beginFunction
void beginFunction(const MachineFunction *MF) override
Gather pre-function debug information.
Definition: DebugHandlerBase.cpp:250
AsmPrinter.h
llvm::DebugHandlerBase::endInstruction
void endInstruction() override
Process end of an instruction.
Definition: DebugHandlerBase.cpp:374
llvm::InstructionOrdering::initialize
void initialize(const MachineFunction &MF)
Definition: DbgEntityHistoryCalculator.cpp:39
llvm::DebugHandlerBase::LScopes
LexicalScopes LScopes
Definition: DebugHandlerBase.h:78
llvm::DebugHandlerBase::beginInstruction
void beginInstruction(const MachineInstr *MI) override
Process beginning of an instruction.
Definition: DebugHandlerBase.cpp:348
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:104
MachineInstr.h
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::DIType
Base class for types.
Definition: DebugInfoMetadata.h:658
llvm::DebugHandlerBase::getLabelAfterInsn
MCSymbol * getLabelAfterInsn(const MachineInstr *MI)
Return Label immediately following the instruction.
Definition: DebugHandlerBase.cpp:142
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
Optional.h
llvm::MachineModuleInfo::getContext
const MCContext & getContext() const
Definition: MachineModuleInfo.h:144
llvm::DIType::getSizeInBits
uint64_t getSizeInBits() const
Definition: DebugInfoMetadata.h:697
T
hasDebugInfo
static bool hasDebugInfo(const MachineModuleInfo *MMI, const MachineFunction *MF)
Definition: DebugHandlerBase.cpp:236
llvm::DbgValueHistoryMap::Entry
Specifies a change in a variable's debug value history.
Definition: DbgEntityHistoryCalculator.h:72
llvm::ilist_node_with_parent::getNextNode
NodeTy * getNextNode()
Get the next node, or nullptr for the list tail.
Definition: ilist_node.h:289
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1185
llvm::LexicalScope
LexicalScope - This class is used to track scope information.
Definition: LexicalScopes.h:44
llvm::Function::getSubprogram
DISubprogram * getSubprogram() const
Get the attached subprogram.
Definition: Metadata.cpp:1573
llvm::TargetSubtargetInfo::getRegisterInfo
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
Definition: TargetSubtargetInfo.h:125
llvm::cl::Hidden
@ Hidden
Definition: CommandLine.h:139
llvm::DebugHandlerBase::PrevInstLoc
DebugLoc PrevInstLoc
Previous instruction's location information.
Definition: DebugHandlerBase.h:67
llvm::MachineModuleInfo::hasDebugInfo
bool hasDebugInfo() const
Returns true if valid debug info is present.
Definition: MachineModuleInfo.h:183
llvm::DenseMapIterator
Definition: DenseMap.h:57
llvm::DebugHandlerBase::beginModule
void beginModule(Module *M) override
Definition: DebugHandlerBase.cpp:103
llvm::getDISubprogram
DISubprogram * getDISubprogram(const MDNode *Scope)
Find subprogram that is enclosing this scope.
Definition: DebugInfo.cpp:128
llvm::DbgVariableLocation::extractFromMachineInstruction
static Optional< DbgVariableLocation > extractFromMachineInstruction(const MachineInstr &Instruction)
Extract a VariableLocation from a MachineInstr.
Definition: DebugHandlerBase.cpp:34
llvm::DebugHandlerBase::requestLabelAfterInsn
void requestLabelAfterInsn(const MachineInstr *MI)
Ensure that a label will be emitted after MI.
Definition: DebugHandlerBase.h:105
llvm::Optional
Definition: APInt.h:33
llvm::DILocalVariable::isParameter
bool isParameter() const
Definition: DebugInfoMetadata.h:3110
llvm::SmallVectorImpl::pop_back_val
LLVM_NODISCARD T pop_back_val()
Definition: SmallVector.h:654
llvm::DIExpression
DWARF expression.
Definition: DebugInfoMetadata.h:2548
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::dwarf::Tag
Tag
Definition: Dwarf.h:105
BaseType
LLVM_DEBUG
#define LLVM_DEBUG(X)
Definition: Debug.h:101
llvm::MachineBasicBlock::isBeginSection
bool isBeginSection() const
Returns true if this block begins any section.
Definition: MachineBasicBlock.h:586
llvm::MachineBasicBlock::getSymbol
MCSymbol * getSymbol() const
Return the MCSymbol for this basic block.
Definition: MachineBasicBlock.cpp:57
CommandLine.h
llvm::DILocalVariable
Local variable.
Definition: DebugInfoMetadata.h:3048
llvm::DebugHandlerBase::Asm
AsmPrinter * Asm
Target of debug info emission.
Definition: DebugHandlerBase.h:58
llvm::SmallVectorImpl::append
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
Definition: SmallVector.h:667
llvm::AsmPrinter::OutStreamer
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
Definition: AsmPrinter.h:96
DebugHandlerBase.h
llvm::DINode::getTag
dwarf::Tag getTag() const
Definition: DebugInfoMetadata.cpp:184
llvm::DIType::getName
StringRef getName() const
Definition: DebugInfoMetadata.h:704
llvm::calculateDbgEntityHistory
void calculateDbgEntityHistory(const MachineFunction *MF, const TargetRegisterInfo *TRI, DbgValueHistoryMap &DbgValues, DbgLabelInstrMap &DbgLabels)
Definition: DbgEntityHistoryCalculator.cpp:449
llvm::DebugHandlerBase::requestLabelBeforeInsn
void requestLabelBeforeInsn(const MachineInstr *MI)
Ensure that a label will be emitted before MI.
Definition: DebugHandlerBase.h:100
llvm::Instruction
Definition: Instruction.h:42
llvm::MachineModuleInfo
This class contains meta information specific to a module.
Definition: MachineModuleInfo.h:75
llvm::DebugHandlerBase::getLabelBeforeInsn
MCSymbol * getLabelBeforeInsn(const MachineInstr *MI)
Return Label preceding the instruction.
Definition: DebugHandlerBase.cpp:135
llvm::None
const NoneType None
Definition: None.h:24
llvm::AsmPrinter::getFunctionBegin
MCSymbol * getFunctionBegin() const
Definition: AsmPrinter.h:263
llvm::MachineBasicBlock
Definition: MachineBasicBlock.h:94
llvm::DebugHandlerBase::endFunctionImpl
virtual void endFunctionImpl(const MachineFunction *MF)=0
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:147
llvm::DILocalVariable::getScope
DILocalScope * getScope() const
Get the local scope for this variable.
Definition: DebugInfoMetadata.h:3106
llvm::DbgVariableLocation
Represents the location at which a variable is stored.
Definition: DebugHandlerBase.h:31
llvm::MachineFunction::getSubtarget
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Definition: MachineFunction.h:640
llvm::cl::opt< bool >
llvm::DbgLabelInstrMap::empty
bool empty() const
Definition: DbgEntityHistoryCalculator.h:143
llvm::DbgValueHistoryMap::dump
LLVM_DUMP_METHOD void dump() const
Definition: DbgEntityHistoryCalculator.cpp:558
llvm::DebugHandlerBase::PrevInstBB
const MachineBasicBlock * PrevInstBB
Definition: DebugHandlerBase.h:69
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:66
uint64_t
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:817
llvm::InstructionOrdering::clear
void clear()
Definition: DbgEntityHistoryCalculator.h:33
DebugInfo.h
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::cl::init
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:432
llvm::DebugHandlerBase::beginFunctionImpl
virtual void beginFunctionImpl(const MachineFunction *MF)=0
llvm::DbgLabelInstrMap::clear
void clear()
Definition: DbgEntityHistoryCalculator.h:144
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::DebugHandlerBase::endBasicBlock
void endBasicBlock(const MachineBasicBlock &MBB) override
Process end of a basic block during basic block sections.
Definition: DebugHandlerBase.cpp:426
llvm::AsmPrinter::MF
MachineFunction * MF
The current machine function.
Definition: AsmPrinter.h:99
MachineModuleInfo.h
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
llvm::DebugHandlerBase::DbgLabels
DbgLabelInstrMap DbgLabels
Mapping of inlined labels and DBG_LABEL machine instruction.
Definition: DebugHandlerBase.h:85
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::DebugHandlerBase::CurMI
const MachineInstr * CurMI
If nonnull, stores the current machine instruction we're processing.
Definition: DebugHandlerBase.h:76
llvm::DebugHandlerBase::skippedNonDebugFunction
virtual void skippedNonDebugFunction()
Definition: DebugHandlerBase.h:111
llvm::MachineFunction
Definition: MachineFunction.h:241
llvm::dwarf::DW_OP_LLVM_arg
@ DW_OP_LLVM_arg
Only used in LLVM metadata.
Definition: Dwarf.h:148
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::DICompileUnit::NoDebug
@ NoDebug
Definition: DebugInfoMetadata.h:1322
llvm::LexicalScopes::empty
bool empty()
empty - Return true if there is any lexical scope information available.
Definition: LexicalScopes.h:153
llvm::dwarf::DW_OP_LLVM_fragment
@ DW_OP_LLVM_fragment
Only used in LLVM metadata.
Definition: Dwarf.h:143
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:1614
TargetSubtargetInfo.h
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
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...
llvm::MachineInstr::getParent
const MachineBasicBlock * getParent() const
Definition: MachineInstr.h:288
llvm::MCContext::createTempSymbol
MCSymbol * createTempSymbol()
Create a temporary symbol with a unique name.
Definition: MCContext.cpp:321
llvm::DebugHandlerBase::beginBasicBlock
void beginBasicBlock(const MachineBasicBlock &MBB) override
Process beginning of a basic block during basic block sections.
Definition: DebugHandlerBase.cpp:419
llvm::MachineBasicBlock::getEndSymbol
MCSymbol * getEndSymbol() const
Returns the MCSymbol marking the end of this basic block.
Definition: MachineBasicBlock.cpp:99
MBB
MachineBasicBlock & MBB
Definition: AArch64SLSHardening.cpp:74
llvm::MachineFunction::getFunction
Function & getFunction()
Return the LLVM function that this machine code represents.
Definition: MachineFunction.h:606
llvm::MachineBasicBlock::isEndSection
bool isEndSection() const
Returns true if this block ends any section.
Definition: MachineBasicBlock.h:589
llvm::AMDGPU::SendMsg::Op
Op
Definition: SIDefines.h:344
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
llvm::DbgValueHistoryMap::empty
bool empty() const
Definition: DbgEntityHistoryCalculator.h:119
llvm::AsmPrinter
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:81
llvm::DIDerivedType
Derived types.
Definition: DebugInfoMetadata.h:924
llvm::DebugHandlerBase::identifyScopeMarkers
void identifyScopeMarkers()
Indentify instructions that are marking the beginning of or ending of a scope.
Definition: DebugHandlerBase.cpp:112
llvm::DebugHandlerBase::PrevLabel
MCSymbol * PrevLabel
Definition: DebugHandlerBase.h:68
llvm::DebugHandlerBase::DebugHandlerBase
DebugHandlerBase(AsmPrinter *A)
Definition: DebugHandlerBase.cpp:101
llvm::DbgValueHistoryMap::clear
void clear()
Definition: DbgEntityHistoryCalculator.h:120
MCStreamer.h
llvm::LexicalScopes::getCurrentFunctionScope
LexicalScope * getCurrentFunctionScope() const
getCurrentFunctionScope - Return lexical scope for the current function.
Definition: LexicalScopes.h:156
llvm::DebugHandlerBase::MMI
MachineModuleInfo * MMI
Collected machine module information.
Definition: DebugHandlerBase.h:61
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:42
llvm::DIExpression::expr_op_end
expr_op_iterator expr_op_end() const
Definition: DebugInfoMetadata.h:2692
llvm::HexStyle::Asm
@ Asm
0ffh
Definition: MCInstPrinter.h:34
llvm::DebugHandlerBase::LabelsAfterInsn
DenseMap< const MachineInstr *, MCSymbol * > LabelsAfterInsn
Maps instruction with label emitted after instruction.
Definition: DebugHandlerBase.h:93
llvm::DebugHandlerBase::isUnsignedDIType
static bool isUnsignedDIType(const DIType *Ty)
Return true if type encoding is unsigned.
Definition: DebugHandlerBase.cpp:176
llvm::DebugLoc
A debug info location.
Definition: DebugLoc.h:33
llvm::DebugHandlerBase::DbgValues
DbgValueHistoryMap DbgValues
History of DBG_VALUE and clobber instructions for each user variable.
Definition: DebugHandlerBase.h:82
MachineFunction.h
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
llvm::DebugHandlerBase::LabelsBeforeInsn
DenseMap< const MachineInstr *, MCSymbol * > LabelsBeforeInsn
Maps instruction with label emitted before instruction.
Definition: DebugHandlerBase.h:90
llvm::DebugHandlerBase::endFunction
void endFunction(const MachineFunction *MF) override
Gather post-function debug information.
Definition: DebugHandlerBase.cpp:409
llvm::DIExpression::expr_op_begin
expr_op_iterator expr_op_begin() const
Visit the elements via ExprOperand wrappers.
Definition: DebugInfoMetadata.h:2689