From b773203fb58f3ef282fb69c832d8710cab5bc82d Mon Sep 17 00:00:00 2001 From: patrick Date: Sun, 27 Jan 2019 16:42:12 +0000 Subject: Import LLVM 7.0.1 release including clang, lld and lldb. --- .../lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp | 30 ++++------------------ 1 file changed, 5 insertions(+), 25 deletions(-) (limited to 'gnu/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp') diff --git a/gnu/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp b/gnu/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp index 2e5c2244793..82e14dc13cb 100644 --- a/gnu/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp +++ b/gnu/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp @@ -25,6 +25,8 @@ using namespace llvm; +#define DEBUG_TYPE "dwarfdebug" + Optional 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 -- cgit v1.2.3-59-g8ed1b