diff options
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h | 7 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 11 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h | 4 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 45 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 36 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h | 5 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 20 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h | 12 |
12 files changed, 77 insertions, 75 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 43d7a38e04a..ec76cd61376 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -670,7 +670,7 @@ static bool emitDebugValueComment(const MachineInstr *MI, AsmPrinter &AP) { raw_svector_ostream OS(Str); OS << "DEBUG_VALUE: "; - DIVariable V = MI->getDebugVariable(); + const MDLocalVariable *V = MI->getDebugVariable(); if (auto *SP = dyn_cast<MDSubprogram>(V->getScope())) { StringRef Name = SP->getDisplayName(); if (!Name.empty()) @@ -678,7 +678,7 @@ static bool emitDebugValueComment(const MachineInstr *MI, AsmPrinter &AP) { } OS << V->getName(); - DIExpression Expr = MI->getDebugExpression(); + const MDExpression *Expr = MI->getDebugExpression(); if (Expr->isBitPiece()) OS << " [bit_piece offset=" << Expr->getBitPieceOffset() << " size=" << Expr->getBitPieceSize() << "]"; diff --git a/llvm/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp b/llvm/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp index 1e3c5d769f1..9cb0aab7705 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp @@ -204,7 +204,7 @@ void llvm::calculateDbgValueHistory(const MachineFunction *MF, // Use the base variable (without any DW_OP_piece expressions) // as index into History. The full variables including the // piece expressions are attached to the MI. - MDLocalVariable *RawVar = MI.getDebugVariable(); + const MDLocalVariable *RawVar = MI.getDebugVariable(); assert(RawVar->isValidLocationForIntrinsic(MI.getDebugLoc()) && "Expected inlined-at fields to agree"); InlinedVariable Var(RawVar, MI.getDebugLoc()->getInlinedAt()); diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h b/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h index a2f6ae1eb73..ff3eb030a65 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h +++ b/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h @@ -72,7 +72,7 @@ public: const ConstantInt *getConstantInt() const { return Constant.CIP; } MachineLocation getLoc() const { return Loc; } bool isBitPiece() const { return getExpression()->isBitPiece(); } - DIExpression getExpression() const { return Expression; } + const MDExpression *getExpression() const { return Expression; } friend bool operator==(const Value &, const Value &); friend bool operator<(const Value &, const Value &); }; @@ -94,9 +94,8 @@ public: /// Return true if the merge was successful. bool MergeValues(const DebugLocEntry &Next) { if (Begin == Next.Begin) { - DIExpression Expr = cast_or_null<MDExpression>(Values[0].Expression); - DIExpression NextExpr = - cast_or_null<MDExpression>(Next.Values[0].Expression); + auto *Expr = cast_or_null<MDExpression>(Values[0].Expression); + auto *NextExpr = cast_or_null<MDExpression>(Next.Values[0].Expression); if (Expr->isBitPiece() && NextExpr->isBitPiece()) { addValues(Next.Values); End = Next.End; diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 3f22070acea..e661ddcd567 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -97,7 +97,8 @@ static const ConstantExpr *getMergedGlobalExpr(const Value *V) { } /// getOrCreateGlobalVariableDIE - get or create global variable DIE. -DIE *DwarfCompileUnit::getOrCreateGlobalVariableDIE(DIGlobalVariable GV) { +DIE *DwarfCompileUnit::getOrCreateGlobalVariableDIE( + const MDGlobalVariable *GV) { // Check for pre-existence. if (DIE *Die = getDIE(GV)) return Die; @@ -632,7 +633,7 @@ DwarfCompileUnit::constructAbstractSubprogramScopeDIE(LexicalScope *Scope) { } std::unique_ptr<DIE> -DwarfCompileUnit::constructImportedEntityDIE(const DIImportedEntity &Module) { +DwarfCompileUnit::constructImportedEntityDIE(const MDImportedEntity *Module) { std::unique_ptr<DIE> IMDie = make_unique<DIE>((dwarf::Tag)Module->getTag()); insertDIE(Module, IMDie.get()); DIE *EntityDie; @@ -687,8 +688,8 @@ void DwarfCompileUnit::collectDeadVariables(const MDSubprogram *SP) { if (!SPDIE) SPDIE = getDIE(SP); assert(SPDIE); - for (DIVariable DV : Variables) { - DbgVariable NewVar(DV, nullptr, DIExpression(), DD); + for (const MDLocalVariable *DV : Variables) { + DbgVariable NewVar(DV, /* IA */ nullptr, /* Expr */ nullptr, DD); auto VariableDie = constructVariableDIE(NewVar); applyVariableAttributes(NewVar, *VariableDie); SPDIE->addChild(std::move(VariableDie)); @@ -763,7 +764,7 @@ void DwarfCompileUnit::addComplexAddress(const DbgVariable &DV, DIE &Die, DIELoc *Loc = new (DIEValueAllocator) DIELoc(); DIEDwarfExpression DwarfExpr(*Asm, *this, *Loc); assert(DV.getExpression().size() == 1); - DIExpression Expr = DV.getExpression().back(); + const MDExpression *Expr = DV.getExpression().back(); bool ValidReg; if (Location.getOffset()) { ValidReg = DwarfExpr.AddMachineRegIndirect(Location.getReg(), diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h index 6ea43c3f615..76811d9401c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h @@ -79,7 +79,7 @@ public: void applyStmtList(DIE &D); /// getOrCreateGlobalVariableDIE - get or create global variable DIE. - DIE *getOrCreateGlobalVariableDIE(DIGlobalVariable GV); + DIE *getOrCreateGlobalVariableDIE(const MDGlobalVariable *GV); /// addLabelAddress - Add a dwarf label attribute data and value using /// either DW_FORM_addr or DW_FORM_GNU_addr_index. @@ -156,7 +156,7 @@ public: /// \brief Construct import_module DIE. std::unique_ptr<DIE> - constructImportedEntityDIE(const DIImportedEntity &Module); + constructImportedEntityDIE(const MDImportedEntity *Module); void finishSubprogramDefinition(const MDSubprogram *SP); diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 8226e1fe9aa..fdea05e50a2 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -422,10 +422,9 @@ DwarfDebug::constructDwarfCompileUnit(const MDCompileUnit *DIUnit) { } void DwarfDebug::constructAndAddImportedEntityDIE(DwarfCompileUnit &TheCU, - const MDNode *N) { - DIImportedEntity Module = cast<MDImportedEntity>(N); - if (DIE *D = TheCU.getOrCreateContextDIE(Module->getScope())) - D->addChild(TheCU.constructImportedEntityDIE(Module)); + const MDImportedEntity *N) { + if (DIE *D = TheCU.getOrCreateContextDIE(N->getScope())) + D->addChild(TheCU.constructImportedEntityDIE(N)); } // Emit all Dwarf sections that should come prior to the content. Create @@ -661,8 +660,9 @@ void DwarfDebug::endModule() { } // Find abstract variable, if any, associated with Var. -DbgVariable *DwarfDebug::getExistingAbstractVariable(InlinedVariable IV, - DIVariable &Cleansed) { +DbgVariable * +DwarfDebug::getExistingAbstractVariable(InlinedVariable IV, + const MDLocalVariable *&Cleansed) { // More then one inlined variable corresponds to one abstract variable. Cleansed = IV.first; auto I = AbstractVariables.find(Cleansed); @@ -672,21 +672,21 @@ DbgVariable *DwarfDebug::getExistingAbstractVariable(InlinedVariable IV, } DbgVariable *DwarfDebug::getExistingAbstractVariable(InlinedVariable IV) { - DIVariable Cleansed; + const MDLocalVariable *Cleansed; return getExistingAbstractVariable(IV, Cleansed); } -void DwarfDebug::createAbstractVariable(const DIVariable &Var, +void DwarfDebug::createAbstractVariable(const MDLocalVariable *Var, LexicalScope *Scope) { auto AbsDbgVariable = - make_unique<DbgVariable>(Var, nullptr, DIExpression(), this); + make_unique<DbgVariable>(Var, /* IA */ nullptr, /* Expr */ nullptr, this); InfoHolder.addScopeVariable(Scope, AbsDbgVariable.get()); AbstractVariables[Var] = std::move(AbsDbgVariable); } void DwarfDebug::ensureAbstractVariableIsCreated(InlinedVariable IV, const MDNode *ScopeNode) { - DIVariable Cleansed; + const MDLocalVariable *Cleansed = nullptr; if (getExistingAbstractVariable(IV, Cleansed)) return; @@ -696,7 +696,7 @@ void DwarfDebug::ensureAbstractVariableIsCreated(InlinedVariable IV, void DwarfDebug::ensureAbstractVariableIsCreatedIfScoped( InlinedVariable IV, const MDNode *ScopeNode) { - DIVariable Cleansed; + const MDLocalVariable *Cleansed = nullptr; if (getExistingAbstractVariable(IV, Cleansed)) return; @@ -722,7 +722,7 @@ void DwarfDebug::collectVariableInfoFromMMITable( if (!Scope) continue; - DIExpression Expr = cast_or_null<MDExpression>(VI.Expr); + const MDExpression *Expr = cast_or_null<MDExpression>(VI.Expr); ensureAbstractVariableIsCreatedIfScoped(Var, Scope->getScopeNode()); auto RegVar = make_unique<DbgVariable>(Var.first, Var.second, Expr, this, VI.Slot); @@ -757,7 +757,7 @@ static DebugLocEntry::Value getDebugLocValue(const MachineInstr *MI) { } /// Determine whether two variable pieces overlap. -static bool piecesOverlap(DIExpression P1, DIExpression P2) { +static bool piecesOverlap(const MDExpression *P1, const MDExpression *P2) { if (!P1->isBitPiece() || !P2->isBitPiece()) return true; unsigned l1 = P1->getBitPieceOffset(); @@ -809,7 +809,7 @@ DwarfDebug::buildLocationList(SmallVectorImpl<DebugLocEntry> &DebugLoc, } // If this piece overlaps with any open ranges, truncate them. - DIExpression DIExpr = Begin->getDebugExpression(); + const MDExpression *DIExpr = Begin->getDebugExpression(); auto Last = std::remove_if(OpenRanges.begin(), OpenRanges.end(), [&](DebugLocEntry::Value R) { return piecesOverlap(DIExpr, R.getExpression()); @@ -930,15 +930,14 @@ void DwarfDebug::collectVariableInfo(DwarfCompileUnit &TheCU, } // Collect info for variables that were optimized out. - for (DIVariable DV : SP->getVariables()) { + for (const MDLocalVariable *DV : SP->getVariables()) { if (!Processed.insert(InlinedVariable(DV, nullptr)).second) continue; if (LexicalScope *Scope = LScopes.findLexicalScope(DV->getScope())) { ensureAbstractVariableIsCreatedIfScoped(InlinedVariable(DV, nullptr), Scope->getScopeNode()); - DIExpression NoExpr; - ConcreteVariables.push_back( - make_unique<DbgVariable>(DV, nullptr, NoExpr, this)); + ConcreteVariables.push_back(make_unique<DbgVariable>( + DV, /* IA */ nullptr, /* Expr */ nullptr, this)); InfoHolder.addScopeVariable(Scope, ConcreteVariables.back().get()); } } @@ -1129,14 +1128,14 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) { // The first mention of a function argument gets the CurrentFnBegin // label, so arguments are visible when breaking at function entry. - DIVariable DIVar = Ranges.front().first->getDebugVariable(); + const MDLocalVariable *DIVar = Ranges.front().first->getDebugVariable(); if (DIVar->getTag() == dwarf::DW_TAG_arg_variable && getDISubprogram(DIVar->getScope())->describes(MF->getFunction())) { LabelsBeforeInsn[Ranges.front().first] = Asm->getFunctionBegin(); if (Ranges.front().first->getDebugExpression()->isBitPiece()) { // Mark all non-overlapping initial pieces. for (auto I = Ranges.begin(); I != Ranges.end(); ++I) { - DIExpression Piece = I->first->getDebugExpression(); + const MDExpression *Piece = I->first->getDebugExpression(); if (std::all_of(Ranges.begin(), I, [&](DbgValueHistoryMap::InstrRange Pred) { return !piecesOverlap(Piece, Pred.first->getDebugExpression()); @@ -1219,7 +1218,7 @@ void DwarfDebug::endFunction(const MachineFunction *MF) { for (LexicalScope *AScope : LScopes.getAbstractScopesList()) { auto *SP = cast<MDSubprogram>(AScope->getScopeNode()); // Collect info for variables that were optimized out. - for (DIVariable DV : SP->getVariables()) { + for (const MDLocalVariable *DV : SP->getVariables()) { if (!ProcessedVars.insert(InlinedVariable(DV, nullptr)).second) continue; ensureAbstractVariableIsCreated(InlinedVariable(DV, nullptr), @@ -1488,7 +1487,7 @@ static void emitDebugLocValue(const AsmPrinter &AP, const MDBasicType *BT, DwarfExpr.AddUnsignedConstant(Value.getInt()); } else if (Value.isLocation()) { MachineLocation Loc = Value.getLoc(); - DIExpression Expr = Value.getExpression(); + const MDExpression *Expr = Value.getExpression(); if (!Expr || !Expr->getNumElements()) // Regular entry. AP.EmitDwarfRegOp(Streamer, Loc); @@ -1523,7 +1522,7 @@ void DebugLocEntry::finalize(const AsmPrinter &AP, DebugLocStream &Locs, unsigned Offset = 0; for (auto Piece : Values) { - DIExpression Expr = Piece.getExpression(); + const MDExpression *Expr = Piece.getExpression(); unsigned PieceOffset = Expr->getBitPieceOffset(); unsigned PieceSize = Expr->getBitPieceSize(); assert(Offset <= PieceOffset && "overlapping or duplicate pieces"); diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h index c33a07b0b42..708fb8f01e5 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -75,9 +75,10 @@ public: /// - Variables that are described by multiple MMI table entries have multiple /// expressions and frame indices. class DbgVariable { - DIVariable Var; /// Variable Descriptor. - DILocation IA; /// Inlined at location. - SmallVector<DIExpression, 1> Expr; /// Complex address location expression. + const MDLocalVariable *Var; /// Variable Descriptor. + const MDLocation *IA; /// Inlined at location. + SmallVector<const MDExpression *, 1> + Expr; /// Complex address location expression. DIE *TheDIE; /// Variable DIE. unsigned DebugLocListIndex; /// Offset in DebugLocs. const MachineInstr *MInsn; /// DBG_VALUE instruction of the variable. @@ -85,9 +86,9 @@ class DbgVariable { DwarfDebug *DD; public: - /// Construct a DbgVariable from a DIVariable. - DbgVariable(DIVariable V, DILocation IA, DIExpression E, DwarfDebug *DD, - int FI = ~0) + /// Construct a DbgVariable from a variable. + DbgVariable(const MDLocalVariable *V, const MDLocation *IA, + const MDExpression *E, DwarfDebug *DD, int FI = ~0) : Var(V), IA(IA), Expr(1, E), TheDIE(nullptr), DebugLocListIndex(~0U), MInsn(nullptr), DD(DD) { FrameIndex.push_back(FI); @@ -105,9 +106,9 @@ public: } // Accessors. - DIVariable getVariable() const { return Var; } - DILocation getInlinedAt() const { return IA; } - const ArrayRef<DIExpression> getExpression() const { return Expr; } + const MDLocalVariable *getVariable() const { return Var; } + const MDLocation *getInlinedAt() const { return IA; } + const ArrayRef<const MDExpression *> getExpression() const { return Expr; } void setDIE(DIE &D) { TheDIE = &D; } DIE *getDIE() const { return TheDIE; } void setDebugLocListIndex(unsigned O) { DebugLocListIndex = O; } @@ -119,7 +120,7 @@ public: void addMMIEntry(const DbgVariable &V) { assert(DebugLocListIndex == ~0U && !MInsn && "not an MMI entry"); assert(V.DebugLocListIndex == ~0U && !V.MInsn && "not an MMI entry"); - assert(V.Var == Var && "conflicting DIVariable"); + assert(V.Var == Var && "conflicting variable"); assert(V.IA == IA && "conflicting inlined-at location"); if (V.getFrameIndex().back() != ~0) { @@ -128,10 +129,11 @@ public: Expr.append(E.begin(), E.end()); FrameIndex.append(FI.begin(), FI.end()); } - assert(Expr.size() > 1 - ? std::all_of(Expr.begin(), Expr.end(), - [](DIExpression &E) { return E->isBitPiece(); }) - : (true && "conflicting locations for variable")); + assert(Expr.size() > 1 ? std::all_of(Expr.begin(), Expr.end(), + [](const MDExpression *E) { + return E->isBitPiece(); + }) + : (true && "conflicting locations for variable")); } // Translate tag to proper Dwarf tag. @@ -334,9 +336,9 @@ class DwarfDebug : public AsmPrinterHandler { /// \brief Find abstract variable associated with Var. DbgVariable *getExistingAbstractVariable(InlinedVariable IV, - DIVariable &Cleansed); + const MDLocalVariable *&Cleansed); DbgVariable *getExistingAbstractVariable(InlinedVariable IV); - void createAbstractVariable(const DIVariable &DV, LexicalScope *Scope); + void createAbstractVariable(const MDLocalVariable *DV, LexicalScope *Scope); void ensureAbstractVariableIsCreated(InlinedVariable Var, const MDNode *Scope); void ensureAbstractVariableIsCreatedIfScoped(InlinedVariable Var, @@ -455,7 +457,7 @@ class DwarfDebug : public AsmPrinterHandler { /// \brief Construct imported_module or imported_declaration DIE. void constructAndAddImportedEntityDIE(DwarfCompileUnit &TheCU, - const MDNode *N); + const MDImportedEntity *N); /// \brief Register a source line with debug info. Returns the unique /// label that was emitted and which provides correspondence to the diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp index e576c93035e..fbe209a6663 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp @@ -192,7 +192,7 @@ static unsigned getOffsetOrZero(unsigned OffsetInBits, return OffsetInBits; } -bool DwarfExpression::AddMachineRegExpression(DIExpression Expr, +bool DwarfExpression::AddMachineRegExpression(const MDExpression *Expr, unsigned MachineReg, unsigned PieceOffsetInBits) { auto I = Expr->expr_op_begin(); @@ -259,7 +259,7 @@ void DwarfExpression::AddExpression(MDExpression::expr_op_iterator I, EmitOp(dwarf::DW_OP_deref); break; default: - llvm_unreachable("unhandled opcode found in DIExpression"); + llvm_unreachable("unhandled opcode found in expression"); } } } diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h index a8b65f50434..3b77a44c28a 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h @@ -88,11 +88,12 @@ public: /// Emit an unsigned constant. void AddUnsignedConstant(unsigned Value); - /// Emit an entire DIExpression on top of a machine register location. + /// \brief Emit an entire expression on top of a machine register location. + /// /// \param PieceOffsetInBits If this is one piece out of a fragmented /// location, this is the offset of the piece inside the entire variable. /// \return false if no DWARF register exists for MachineReg. - bool AddMachineRegExpression(DIExpression Expr, unsigned MachineReg, + bool AddMachineRegExpression(const MDExpression *Expr, unsigned MachineReg, unsigned PieceOffsetInBits = 0); /// Emit a the operations remaining the DIExpressionIterator I. /// \param PieceOffsetInBits If this is one piece out of a fragmented diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp index 32adb40f5a2..29a163b8f06 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp @@ -137,7 +137,7 @@ void DwarfFile::emitStrings(const MCSection *StrSection, bool DwarfFile::addScopeVariable(LexicalScope *LS, DbgVariable *Var) { SmallVectorImpl<DbgVariable *> &Vars = ScopeVariables[LS]; - DIVariable DV = Var->getVariable(); + const MDLocalVariable *DV = Var->getVariable(); // Variables with positive arg numbers are parameters. if (unsigned ArgNum = DV->getArg()) { // Keep all parameters in order at the start of the variable list to ensure diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 750b8525695..ad1ef544b01 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -354,14 +354,14 @@ void DwarfUnit::addSourceLine(DIE &Die, unsigned Line, StringRef File, addUInt(Die, dwarf::DW_AT_decl_line, None, Line); } -void DwarfUnit::addSourceLine(DIE &Die, DIVariable V) { +void DwarfUnit::addSourceLine(DIE &Die, const MDLocalVariable *V) { assert(V); addSourceLine(Die, V->getLine(), V->getScope()->getFilename(), V->getScope()->getDirectory()); } -void DwarfUnit::addSourceLine(DIE &Die, DIGlobalVariable G) { +void DwarfUnit::addSourceLine(DIE &Die, const MDGlobalVariable *G) { assert(G); addSourceLine(Die, G->getLine(), G->getFilename(), G->getDirectory()); @@ -379,7 +379,7 @@ void DwarfUnit::addSourceLine(DIE &Die, const MDType *Ty) { addSourceLine(Die, Ty->getLine(), Ty->getFilename(), Ty->getDirectory()); } -void DwarfUnit::addSourceLine(DIE &Die, DIObjCProperty Ty) { +void DwarfUnit::addSourceLine(DIE &Die, const MDObjCProperty *Ty) { assert(Ty); addSourceLine(Die, Ty->getLine(), Ty->getFilename(), Ty->getDirectory()); @@ -976,7 +976,7 @@ void DwarfUnit::constructTypeDIE(DIE &Buffer, const MDCompositeType *CTy) { } else { constructMemberDIE(Buffer, DDTy); } - } else if (DIObjCProperty Property = dyn_cast<MDObjCProperty>(Element)) { + } else if (auto *Property = dyn_cast<MDObjCProperty>(Element)) { DIE &ElemDie = createAndAddDIE(Property->getTag(), Buffer); StringRef PropertyName = Property->getName(); addString(ElemDie, dwarf::DW_AT_APPLE_property_name, PropertyName); @@ -1057,8 +1057,8 @@ void DwarfUnit::constructTypeDIE(DIE &Buffer, const MDCompositeType *CTy) { } } -void DwarfUnit::constructTemplateTypeParameterDIE(DIE &Buffer, - DITemplateTypeParameter TP) { +void DwarfUnit::constructTemplateTypeParameterDIE( + DIE &Buffer, const MDTemplateTypeParameter *TP) { DIE &ParamDIE = createAndAddDIE(dwarf::DW_TAG_template_type_parameter, Buffer); // Add the type if it exists, it could be void and therefore no type. @@ -1068,9 +1068,8 @@ void DwarfUnit::constructTemplateTypeParameterDIE(DIE &Buffer, addString(ParamDIE, dwarf::DW_AT_name, TP->getName()); } -void -DwarfUnit::constructTemplateValueParameterDIE(DIE &Buffer, - DITemplateValueParameter VP) { +void DwarfUnit::constructTemplateValueParameterDIE( + DIE &Buffer, const MDTemplateValueParameter *VP) { DIE &ParamDIE = createAndAddDIE(VP->getTag(), Buffer); // Add the type if there is one, template template and template parameter @@ -1270,7 +1269,8 @@ void DwarfUnit::applySubprogramAttributes(const MDSubprogram *SP, DIE &SPDie, addFlag(SPDie, dwarf::DW_AT_explicit); } -void DwarfUnit::constructSubrangeDIE(DIE &Buffer, DISubrange SR, DIE *IndexTy) { +void DwarfUnit::constructSubrangeDIE(DIE &Buffer, const MDSubrange *SR, + DIE *IndexTy) { DIE &DW_Subrange = createAndAddDIE(dwarf::DW_TAG_subrange_type, Buffer); addDIEEntry(DW_Subrange, dwarf::DW_AT_type, *IndexTy); diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h index a236a4a7a97..7041f376ef4 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h @@ -246,12 +246,12 @@ public: /// \brief Add location information to specified debug information entry. void addSourceLine(DIE &Die, unsigned Line, StringRef File, StringRef Directory); - void addSourceLine(DIE &Die, DIVariable V); - void addSourceLine(DIE &Die, DIGlobalVariable G); + void addSourceLine(DIE &Die, const MDLocalVariable *V); + void addSourceLine(DIE &Die, const MDGlobalVariable *G); void addSourceLine(DIE &Die, const MDSubprogram *SP); void addSourceLine(DIE &Die, const MDType *Ty); void addSourceLine(DIE &Die, const MDNamespace *NS); - void addSourceLine(DIE &Die, DIObjCProperty Ty); + void addSourceLine(DIE &Die, const MDObjCProperty *Ty); /// \brief Add constant value entry in variable DIE. void addConstantValue(DIE &Die, const MachineOperand &MO, const MDType *Ty); @@ -355,14 +355,14 @@ private: void constructTypeDIE(DIE &Buffer, const MDBasicType *BTy); void constructTypeDIE(DIE &Buffer, const MDDerivedType *DTy); void constructTypeDIE(DIE &Buffer, const MDSubroutineType *DTy); - void constructSubrangeDIE(DIE &Buffer, DISubrange SR, DIE *IndexTy); + void constructSubrangeDIE(DIE &Buffer, const MDSubrange *SR, DIE *IndexTy); void constructArrayTypeDIE(DIE &Buffer, const MDCompositeType *CTy); void constructEnumTypeDIE(DIE &Buffer, const MDCompositeType *CTy); void constructMemberDIE(DIE &Buffer, const MDDerivedType *DT); void constructTemplateTypeParameterDIE(DIE &Buffer, - DITemplateTypeParameter TP); + const MDTemplateTypeParameter *TP); void constructTemplateValueParameterDIE(DIE &Buffer, - DITemplateValueParameter TVP); + const MDTemplateValueParameter *TVP); /// \brief Return the default lower bound for an array. /// |