diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-30 16:33:32 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-30 16:33:32 +0000 |
commit | 51315c45ff5643a27f9c84b816db54ee870ba29b (patch) | |
tree | 1d87443fa0e53d3e6b315ce25787e64be0906bf7 /contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp | |
parent | 6dfd050075216be8538ae375a22d30db72916f7e (diff) | |
parent | eb11fae6d08f479c0799db45860a98af528fa6e7 (diff) |
Notes
Diffstat (limited to 'contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp')
-rw-r--r-- | contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp b/contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp index 2e5c22447936..82e14dc13cb1 100644 --- a/contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp +++ b/contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp @@ -25,6 +25,8 @@ using namespace llvm; +#define DEBUG_TYPE "dwarfdebug" + Optional<DbgVariableLocation> DbgVariableLocation::extractFromMachineInstruction( const MachineInstr &Instruction) { @@ -123,29 +125,6 @@ MCSymbol *DebugHandlerBase::getLabelAfterInsn(const MachineInstr *MI) { return LabelsAfterInsn.lookup(MI); } -int DebugHandlerBase::fragmentCmp(const DIExpression *P1, - const DIExpression *P2) { - auto Fragment1 = *P1->getFragmentInfo(); - auto Fragment2 = *P2->getFragmentInfo(); - unsigned l1 = Fragment1.OffsetInBits; - unsigned l2 = Fragment2.OffsetInBits; - unsigned r1 = l1 + Fragment1.SizeInBits; - unsigned r2 = l2 + Fragment2.SizeInBits; - if (r1 <= l2) - return -1; - else if (r2 <= l1) - return 1; - else - return 0; -} - -bool DebugHandlerBase::fragmentsOverlap(const DIExpression *P1, - const DIExpression *P2) { - if (!P1->isFragment() || !P2->isFragment()) - return true; - return fragmentCmp(P1, P2) == 0; -} - /// If this type is derived from a base type then return base type size. uint64_t DebugHandlerBase::getBaseTypeSize(const DITypeRef TyRef) { DIType *Ty = TyRef.resolve(); @@ -213,6 +192,7 @@ void DebugHandlerBase::beginFunction(const MachineFunction *MF) { assert(DbgValues.empty() && "DbgValues map wasn't cleaned!"); calculateDbgValueHistory(MF, Asm->MF->getSubtarget().getRegisterInfo(), DbgValues); + LLVM_DEBUG(DbgValues.dump()); // Request labels for the full history. for (const auto &I : DbgValues) { @@ -232,8 +212,8 @@ void DebugHandlerBase::beginFunction(const MachineFunction *MF) { const DIExpression *Fragment = I->first->getDebugExpression(); if (std::all_of(Ranges.begin(), I, [&](DbgValueHistoryMap::InstrRange Pred) { - return !fragmentsOverlap( - Fragment, Pred.first->getDebugExpression()); + return !Fragment->fragmentsOverlap( + Pred.first->getDebugExpression()); })) LabelsBeforeInsn[I->first] = Asm->getFunctionBegin(); else |