From 0b944ee36f85ff0af849f35dfb59dced15dcde5a Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Tue, 11 Dec 2012 19:42:09 +0000 Subject: Update some comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169907 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfDebug.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.h') diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index 9ddefee8e7..c03915aad1 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -358,12 +358,12 @@ class DwarfDebug { bool HasDwarfAccelTables; bool HasSplitDwarf; - // Fission Variables + // Separated Dwarf Variables // In general these will all be for bits that are left in the // original object file, rather than things that are meant // to be in the .dwo sections. - // The CU left in the original object file for Fission debug info. + // The CU left in the original object file for separated debug info. CompileUnit *SkeletonCU; DwarfUnits SkeletonHolder; -- cgit v1.2.3-18-g5258 From b1e66d0c4fed6f162424fd5257cedf0d2e705152 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Sat, 15 Dec 2012 00:04:07 +0000 Subject: To simplify some code move the unit emission into the holders. Make emitDIE public accordingly. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170258 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfDebug.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.h') diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index c03915aad1..738f117ad0 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -219,6 +219,11 @@ public: /// \brief Add a unit to the list of CUs. void addUnit(CompileUnit *CU) { CUs.push_back(CU); } + + /// \brief Emit all of the units to the section listed with the given + /// abbreviation section. + void emitUnits(DwarfDebug *, const MCSection *, const MCSection *, + const MCSymbol *); }; /// \brief Collects and handles dwarf debug information. @@ -394,9 +399,6 @@ private: /// \brief Emit initial Dwarf sections with a label at the start of each one. void emitSectionLabels(); - /// \brief Recursively Emits a debug information entry. - void emitDIE(DIE *Die); - /// \brief Compute the size and offset of a DIE given an incoming Offset. unsigned computeSizeAndOffset(DIE *Die, unsigned Offset); @@ -417,9 +419,6 @@ private: /// open. void endSections(); - /// \brief Emit all of the compile units to the target section. - void emitCompileUnits(const MCSection *); - /// \brief Emit the debug info section. void emitDebugInfo(); @@ -569,6 +568,9 @@ public: /// string text. MCSymbol *getStringPoolEntry(StringRef Str); + /// \brief Recursively Emits a debug information entry. + void emitDIE(DIE *Die); + /// \brief Returns whether or not to limit some of our debug /// output to the limitations of darwin gdb. bool useDarwinGDBCompat() { return IsDarwinGDBCompat; } -- cgit v1.2.3-18-g5258 From 0641bd7399c8c3269779b0ba2de47d02524725ba Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Sun, 16 Dec 2012 12:57:36 +0000 Subject: Declare class DwarfDebug before use instead of relying on a forward declaration from some other unrelated header. Patch by Kai. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170284 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfDebug.h | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.h') diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index 738f117ad0..63a3214c17 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -41,6 +41,7 @@ class DIEAbbrev; class DIE; class DIEBlock; class DIEEntry; +class DwarfDebug; //===----------------------------------------------------------------------===// /// \brief This class is used to record source line correspondence. -- cgit v1.2.3-18-g5258 From 034b94b17006f51722886b0f2283fb6fb19aca1f Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 19 Dec 2012 07:18:57 +0000 Subject: Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170502 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfDebug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.h') diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index 63a3214c17..cf1abef8c7 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -239,7 +239,7 @@ class DwarfDebug { BumpPtrAllocator DIEValueAllocator; //===--------------------------------------------------------------------===// - // Attributes used to construct specific Dwarf sections. + // Attribute used to construct specific Dwarf sections. // CompileUnit *FirstCU; -- cgit v1.2.3-18-g5258 From 6eebe47060eec7e3a4ae95d4b4835869108f9c07 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Wed, 19 Dec 2012 22:02:53 +0000 Subject: Split out abbreviations for the skeleton info from the rest of the abbreviations. Part of implementing split dwarf. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170589 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfDebug.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.h') diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index cf1abef8c7..58ae3d68d1 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -343,6 +343,7 @@ class DwarfDebug { MCSymbol *DwarfStrSectionSym, *TextSectionSym, *DwarfDebugRangeSectionSym; MCSymbol *DwarfDebugLocSectionSym; MCSymbol *FunctionBeginSym, *FunctionEndSym; + MCSymbol *DwarfAbbrevDWOSectionSym; // As an optimization, there is no need to emit an entry in the directory // table for the same directory as DW_at_comp_dir. @@ -371,6 +372,13 @@ class DwarfDebug { // The CU left in the original object file for separated debug info. CompileUnit *SkeletonCU; + + // Used to uniquely define abbreviations for the skeleton emission. + FoldingSet SkeletonAbbrevSet; + + // A list of all the unique abbreviations in use. + std::vector SkeletonAbbrevs; + DwarfUnits SkeletonHolder; private: @@ -420,6 +428,9 @@ private: /// open. void endSections(); + /// \brief Emit a set of abbreviations to the specific section. + void emitAbbrevs(const MCSection *, std::vector *); + /// \brief Emit the debug info section. void emitDebugInfo(); @@ -473,9 +484,15 @@ private: /// \brief Emit the local split debug info section. void emitSkeletonCU(const MCSection *); + /// \brief Emit the local split abbreviations. + void emitSkeletonAbbrevs(const MCSection *); + /// \brief Emit the debug info dwo section. void emitDebugInfoDWO(); + /// \brief Emit the debug abbrev dwo section. + void emitDebugAbbrevDWO(); + /// \brief Create new CompileUnit for the given metadata node with tag /// DW_TAG_compile_unit. CompileUnit *constructCompileUnit(const MDNode *N); @@ -570,7 +587,7 @@ public: MCSymbol *getStringPoolEntry(StringRef Str); /// \brief Recursively Emits a debug information entry. - void emitDIE(DIE *Die); + void emitDIE(DIE *Die, std::vector *Abbrevs); /// \brief Returns whether or not to limit some of our debug /// output to the limitations of darwin gdb. -- cgit v1.2.3-18-g5258 From 2e5d870b384f7cc20ba040e827d54fa473f60800 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Thu, 20 Dec 2012 21:58:36 +0000 Subject: Start splitting out the debug string section handling by moving it into the DwarfUnits class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170770 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfDebug.h | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.h') diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index 58ae3d68d1..71e78c2211 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -189,6 +189,12 @@ public: DIType getType() const; }; + +// A String->Symbol mapping of strings used by indirect +// references. +typedef StringMap, + BumpPtrAllocator&> StrPool; + /// \brief Collects and handles information specific to a particular /// collection of units. class DwarfUnits { @@ -204,10 +210,15 @@ class DwarfUnits { // A pointer to all units in the section. SmallVector CUs; + // Collection of strings for this unit. + StrPool *StringPool; + unsigned NextStringPoolNumber; + public: DwarfUnits(AsmPrinter *AP, FoldingSet *AS, - std::vector *A) : - Asm(AP), AbbreviationsSet(AS), Abbreviations(A) {} + std::vector *A, StrPool *SP) : + Asm(AP), AbbreviationsSet(AS), Abbreviations(A), + StringPool(SP), NextStringPoolNumber(0) {} /// \brief Compute the size and offset of a DIE given an incoming Offset. unsigned computeSizeAndOffset(DIE *Die, unsigned Offset); @@ -225,6 +236,16 @@ public: /// abbreviation section. void emitUnits(DwarfDebug *, const MCSection *, const MCSection *, const MCSymbol *); + + /// \brief Returns the entry into the start of the pool. + MCSymbol *getStringPoolSym(); + + /// \brief Returns an entry into the string pool with the given + /// string text. + MCSymbol *getStringPoolEntry(StringRef Str); + + /// \brief Returns the string pool. + StrPool *getStringPool() { return StringPool; } }; /// \brief Collects and handles dwarf debug information. @@ -262,8 +283,7 @@ class DwarfDebug { // A String->Symbol mapping of strings used by indirect // references. - StringMap, BumpPtrAllocator&> StringPool; - unsigned NextStringPoolNumber; + StrPool InfoStringPool; // Provides a unique id per text section. SetVector SectionMap; @@ -579,13 +599,6 @@ public: /// SourceIds map. unsigned getOrCreateSourceID(StringRef DirName, StringRef FullName); - /// \brief Returns the entry into the start of the pool. - MCSymbol *getStringPool(); - - /// \brief Returns an entry into the string pool with the given - /// string text. - MCSymbol *getStringPoolEntry(StringRef Str); - /// \brief Recursively Emits a debug information entry. void emitDIE(DIE *Die, std::vector *Abbrevs); -- cgit v1.2.3-18-g5258 From 72c1655e0af6c87ffe687bed1f4ed263b1165c06 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Thu, 20 Dec 2012 21:58:40 +0000 Subject: Whitespace and 80-column cleanup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170771 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfDebug.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.h') diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index 71e78c2211..870b588cf7 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -315,7 +315,8 @@ class DwarfDebug { DenseMap > InlineInfo; SmallVector InlinedSPNodes; - // This is a collection of subprogram MDNodes that are processed to create DIEs. + // This is a collection of subprogram MDNodes that are processed to + // create DIEs. SmallPtrSet ProcessedSPNodes; // Maps instruction with label emitted before instruction. -- cgit v1.2.3-18-g5258 From 64f824c9d181c8ee78cba5b00fa7be0e5a0900a5 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Thu, 27 Dec 2012 02:14:01 +0000 Subject: For the dwarf5 split debug info code split out the string section per compile unit/skeleton compile unit. Update tests accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171133 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfDebug.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.h') diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index 870b588cf7..59e4890dec 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -210,15 +210,17 @@ class DwarfUnits { // A pointer to all units in the section. SmallVector CUs; - // Collection of strings for this unit. + // Collection of strings for this unit and assorted symbols. StrPool *StringPool; unsigned NextStringPoolNumber; + std::string StringPref; public: DwarfUnits(AsmPrinter *AP, FoldingSet *AS, - std::vector *A, StrPool *SP) : + std::vector *A, + StrPool *SP, const char *Pref) : Asm(AP), AbbreviationsSet(AS), Abbreviations(A), - StringPool(SP), NextStringPoolNumber(0) {} + StringPool(SP), NextStringPoolNumber(0), StringPref(Pref) {} /// \brief Compute the size and offset of a DIE given an incoming Offset. unsigned computeSizeAndOffset(DIE *Die, unsigned Offset); @@ -237,6 +239,9 @@ public: void emitUnits(DwarfDebug *, const MCSection *, const MCSection *, const MCSymbol *); + /// \brief Emit all of the strings to the section given. + void emitStrings(const MCSection *); + /// \brief Returns the entry into the start of the pool. MCSymbol *getStringPoolSym(); @@ -364,7 +369,7 @@ class DwarfDebug { MCSymbol *DwarfStrSectionSym, *TextSectionSym, *DwarfDebugRangeSectionSym; MCSymbol *DwarfDebugLocSectionSym; MCSymbol *FunctionBeginSym, *FunctionEndSym; - MCSymbol *DwarfAbbrevDWOSectionSym; + MCSymbol *DwarfAbbrevDWOSectionSym, *DwarfStrDWOSectionSym; // As an optimization, there is no need to emit an entry in the directory // table for the same directory as DW_at_comp_dir. @@ -394,12 +399,16 @@ class DwarfDebug { // The CU left in the original object file for separated debug info. CompileUnit *SkeletonCU; - // Used to uniquely define abbreviations for the skeleton emission. + // Used to uniquely define abbreviations for the skeleton emission. FoldingSet SkeletonAbbrevSet; // A list of all the unique abbreviations in use. std::vector SkeletonAbbrevs; + // List of strings used in the skeleton. + StrPool SkeletonStringPool; + + // Holder for the skeleton information. DwarfUnits SkeletonHolder; private: @@ -514,6 +523,9 @@ private: /// \brief Emit the debug abbrev dwo section. void emitDebugAbbrevDWO(); + /// \brief Emit the debug str dwo section. + void emitDebugStrDWO(); + /// \brief Create new CompileUnit for the given metadata node with tag /// DW_TAG_compile_unit. CompileUnit *constructCompileUnit(const MDNode *N); -- cgit v1.2.3-18-g5258 From dd8e9f395e881972b320d947de88102a0be04b70 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Mon, 7 Jan 2013 19:32:41 +0000 Subject: Add support for separating strings for the split debug info DWARF5 proposal. This leaves the strings in the skeleton die as strp, but in all dwo files they're accessed now via DW_FORM_GNU_str_index. Add support for dumping these sections and modify the fission-cu.ll testcase to have the correct strings and form. Fix a small bug in the fixed form sizes routine that involved out of array accesses for the table and add a FIXME in the extractFast routine to fix this up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171779 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfDebug.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.h') diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index 59e4890dec..cc6c0f7e63 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -240,7 +240,7 @@ public: const MCSymbol *); /// \brief Emit all of the strings to the section given. - void emitStrings(const MCSection *); + void emitStrings(const MCSection *, const MCSection *, const MCSymbol *); /// \brief Returns the entry into the start of the pool. MCSymbol *getStringPoolSym(); @@ -249,6 +249,10 @@ public: /// string text. MCSymbol *getStringPoolEntry(StringRef Str); + /// \brief Returns the index into the string pool with the given + /// string text. + unsigned getStringPoolIndex(StringRef Str); + /// \brief Returns the string pool. StrPool *getStringPool() { return StringPool; } }; -- cgit v1.2.3-18-g5258 From b6714227eda5d499f7667fc865f931126a8dc488 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Tue, 8 Jan 2013 22:22:06 +0000 Subject: Move the string pools down into the units. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171905 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfDebug.h | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.h') diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index cc6c0f7e63..1e471f75f5 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -211,16 +211,16 @@ class DwarfUnits { SmallVector CUs; // Collection of strings for this unit and assorted symbols. - StrPool *StringPool; + StrPool StringPool; unsigned NextStringPoolNumber; std::string StringPref; public: DwarfUnits(AsmPrinter *AP, FoldingSet *AS, - std::vector *A, - StrPool *SP, const char *Pref) : + std::vector *A, const char *Pref, + BumpPtrAllocator &DA) : Asm(AP), AbbreviationsSet(AS), Abbreviations(A), - StringPool(SP), NextStringPoolNumber(0), StringPref(Pref) {} + StringPool(DA), NextStringPoolNumber(0), StringPref(Pref) {} /// \brief Compute the size and offset of a DIE given an incoming Offset. unsigned computeSizeAndOffset(DIE *Die, unsigned Offset); @@ -254,7 +254,7 @@ public: unsigned getStringPoolIndex(StringRef Str); /// \brief Returns the string pool. - StrPool *getStringPool() { return StringPool; } + StrPool *getStringPool() { return &StringPool; } }; /// \brief Collects and handles dwarf debug information. @@ -290,10 +290,6 @@ class DwarfDebug { // separated by a zero byte, mapped to a unique id. StringMap SourceIdMap; - // A String->Symbol mapping of strings used by indirect - // references. - StrPool InfoStringPool; - // Provides a unique id per text section. SetVector SectionMap; @@ -409,9 +405,6 @@ class DwarfDebug { // A list of all the unique abbreviations in use. std::vector SkeletonAbbrevs; - // List of strings used in the skeleton. - StrPool SkeletonStringPool; - // Holder for the skeleton information. DwarfUnits SkeletonHolder; -- cgit v1.2.3-18-g5258