From 8feff8d14f75aafe4af77a6295d59d28e7a72829 Mon Sep 17 00:00:00 2001 From: Igor Kudrin Date: Mon, 3 Aug 2020 15:04:00 +0700 Subject: [PATCH] [DebugInfo] Fix a comment and a variable name. NFC. DebugLocListIndex keeps the index of an entry list, not the offset. Differential Revision: https://reviews.llvm.org/D84093 --- llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 6 +++--- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 2de6569..871977d 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -678,9 +678,9 @@ DIE *DwarfCompileUnit::constructVariableDIEImpl(const DbgVariable &DV, // Add variable address. - unsigned Offset = DV.getDebugLocListIndex(); - if (Offset != ~0U) { - addLocationList(*VariableDie, dwarf::DW_AT_location, Offset); + unsigned Index = DV.getDebugLocListIndex(); + if (Index != ~0U) { + addLocationList(*VariableDie, dwarf::DW_AT_location, Index); auto TagOffset = DV.getDebugLocListTagOffset(); if (TagOffset) addUInt(*VariableDie, dwarf::DW_AT_LLVM_tag_offset, dwarf::DW_FORM_data1, diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h index 2587ee6..3436413 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -114,7 +114,7 @@ public: /// /// Variables that have been optimized out use none of these fields. class DbgVariable : public DbgEntity { - /// Offset in DebugLocs. + /// Index of the entry list in DebugLocs. unsigned DebugLocListIndex = ~0u; /// DW_OP_LLVM_tag_offset value from DebugLocs. Optional DebugLocListTagOffset; -- 2.7.4