35 while (!WorkList.
empty()) {
39 if (!Children.
empty())
46 assert(R.first &&
"InsnRange does not have first instruction!");
47 assert(R.second &&
"InsnRange does not have second instruction!");
57 assert(Label &&
"Didn't insert label before instruction");
70 unsigned l1 = Fragment1.OffsetInBits;
71 unsigned l2 = Fragment2.OffsetInBits;
72 unsigned r1 = l1 + Fragment1.SizeInBits;
73 unsigned r2 = l2 + Fragment2.SizeInBits;
99 if (Tag != dwarf::DW_TAG_member && Tag != dwarf::DW_TAG_typedef &&
100 Tag != dwarf::DW_TAG_const_type && Tag != dwarf::DW_TAG_volatile_type &&
101 Tag != dwarf::DW_TAG_restrict_type && Tag != dwarf::DW_TAG_atomic_type)
106 assert(BaseType &&
"Unexpected invalid base type");
111 if (BaseType->
getTag() == dwarf::DW_TAG_reference_type ||
112 BaseType->
getTag() == dwarf::DW_TAG_rvalue_reference_type)
126 auto EK = SP->getUnit()->getEmissionKind();
158 const auto &Ranges =
I.second;
164 const DILocalVariable *DIVar = Ranges.front().first->getDebugVariable();
168 if (Ranges.front().first->getDebugExpression()->isFragment()) {
170 for (
auto I = Ranges.begin();
I != Ranges.end(); ++
I) {
171 const DIExpression *Fragment =
I->first->getDebugExpression();
175 Fragment, Pred.first->getDebugExpression());
184 for (
const auto &Range : Ranges) {
void push_back(const T &Elt)
void calculateDbgValueHistory(const MachineFunction *MF, const TargetRegisterInfo *TRI, DbgValueHistoryMap &Result)
static void r2(uint32_t &A, uint32_t &B, uint32_t &C, uint32_t &D, uint32_t &E, int I, uint32_t *Buf)
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
DILocalScope * getScope() const
Get the local scope for this variable.
const MachineFunction * MF
The current machine function.
SmallVectorImpl< InsnRange > & getRanges()
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly...
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
std::pair< const MachineInstr *, const MachineInstr * > InstrRange
LexicalScope - This class is used to track scope information.
const MachineInstr * CurMI
If nonnull, stores the current machine instruction we're processing.
DebugLoc PrevInstLoc
Previous instruction's location information.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
SmallVectorImpl< LexicalScope * > & getChildren()
DbgValueHistoryMap DbgValues
History of DBG_VALUE and clobber instructions for each user variable.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void beginFunction(const MachineFunction *MF) override
Gather pre-function debug information.
Holds a subclass of DINode.
bool hasDebugInfo() const
Returns true if valid debug info is present.
DISubprogram * getDISubprogram(const MDNode *Scope)
Find subprogram that is enclosing this scope.
LLVM_NODISCARD bool empty() const
LexicalScope * getCurrentFunctionScope() const
getCurrentFunctionScope - Return lexical scope for the current function.
DebugHandlerBase(AsmPrinter *A)
void identifyScopeMarkers()
Indentify instructions that are marking the beginning of or ending of a scope.
void initialize(const MachineFunction &)
initialize - Scan machine function and constuct lexical scope nest, resets the instance if necessary...
bool isMetaInstruction() const
Return true if this instruction doesn't produce any output in the form of executable instructions...
static Optional< FragmentInfo > getFragmentInfo(expr_op_iterator Start, expr_op_iterator End)
Retrieve the details of this fragment expression.
virtual void endFunctionImpl(const MachineFunction *MF)=0
DenseMap< const MachineInstr *, MCSymbol * > LabelsAfterInsn
Maps instruction with label emitted after instruction.
void requestLabelBeforeInsn(const MachineInstr *MI)
Ensure that a label will be emitted before MI.
bool isFragment() const
Return whether this is a piece of an aggregate variable.
const MachineBasicBlock * getParent() const
MCSymbol * createTempSymbol(bool CanBeUnnamed=true)
Create and return a new assembler temporary symbol with a unique but unspecified name.
static bool fragmentsOverlap(const DIExpression *P1, const DIExpression *P2)
Determine whether two variable fragments overlap.
const MachineBasicBlock * PrevInstBB
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
AsmPrinter * Asm
Target of debug info emission.
This class is intended to be used as a driving class for all asm writers.
DenseMap< const MachineInstr *, MCSymbol * > LabelsBeforeInsn
Maps instruction with label emitted before instruction.
void beginInstruction(const MachineInstr *MI) override
Process beginning of an instruction.
bool isAbstractScope() const
void endFunction(const MachineFunction *MF) override
Gather post-function debug information.
static void r1(uint32_t &A, uint32_t &B, uint32_t &C, uint32_t &D, uint32_t &E, int I, uint32_t *Buf)
MCSymbol * getLabelAfterInsn(const MachineInstr *MI)
Return Label immediately following the instruction.
BaseType
A given derived pointer can have multiple base pointers through phi/selects.
virtual void skippedNonDebugFunction()
virtual void beginFunctionImpl(const MachineFunction *MF)=0
static bool hasDebugInfo(const MachineModuleInfo *MMI, const MachineFunction *MF)
const MCContext & getContext() const
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
LLVM_NODISCARD T pop_back_val()
DISubprogram * getSubprogram() const
Get the attached subprogram.
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
void requestLabelAfterInsn(const MachineInstr *MI)
Ensure that a label will be emitted after MI.
Representation of each machine instruction.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
MCSymbol * getFunctionBegin() const
uint64_t getSizeInBits() const
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
void endInstruction() override
Process end of an instruction.
MCSymbol * getLabelBeforeInsn(const MachineInstr *MI)
Return Label preceding the instruction.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static int fragmentCmp(const DIExpression *P1, const DIExpression *P2)
Determine the relative position of the fragments described by P1 and P2.
MachineModuleInfo * MMI
Collected machine module information.
static uint64_t getBaseTypeSize(const DITypeRef TyRef)
If this type is derived from a base type then return base type size.
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
std::pair< const MachineInstr *, const MachineInstr * > InsnRange
InsnRange - This is used to track range of instructions with identical lexical scope.
bool empty()
empty - Return true if there is any lexical scope information available.
This class contains meta information specific to a module.