summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Debug info: Remove OdrMemberMap from DwarfDebug, it's not necessary.Adrian Prantl2014-03-181-8/+0
| | | | | | Follow-up to r203982. llvm-svn: 204162
* Switch the type field in DIVariable and DIGlobalVariable over to DITypeRefs.Adrian Prantl2014-03-181-4/+6
| | | | | | | | | This allows us to catch more opportunities for ODR-based type uniquing during LTO. Paired commit with CFE which updates some testcases to verify the new DIBuilder behavior. llvm-svn: 204106
* Replace unnecessary #include directive with forward declarations.Adrian Prantl2014-03-181-1/+2
| | | | llvm-svn: 204104
* Shorten DotDebugLocEntry to just DebugLocEntry and reformat.Eric Christopher2014-03-181-19/+13
| | | | | | No functional change. llvm-svn: 204102
* DebugInfo: Avoid emitting standard opcode lengths in debug_line.dwo headers ↵David Blaikie2014-03-181-1/+1
| | | | | | | | | where opcodes are never used anyway Introduce a slightly tighter wrapper around the header structure that handles this use case. (MCDwarfDwoLineTable) llvm-svn: 204101
* DebugInfo: Implement debug_line.dwo for file names used in type units during ↵David Blaikie2014-03-181-0/+8
| | | | | | | | | | | | | | | | | | | | -gsplit-dwarf This removes an attribute (and more importantly, a relocation) from skeleton type units and removes some unnecessary file names from the debug_line section that remains in the .o (and linked executable) file. There's still a few places we could shave off some more space here: * use compilation dir of the underlying compilation unit (since all the type units share that compilation dir - though this would be more complicated in LTO cases where they don't (keep a map of compilation dir->line table header?)) * Remove some of the unnecessary header fields from the line table since they're not needed in this situation (about 12 bytes per table). llvm-svn: 204099
* DebugInfo: Do not rely on the compilation dir (index 0) for files in line ↵David Blaikie2014-03-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | tables shared between compilation units When emitting assembly there's no support for emitting separate line tables for each compilation unit - so LLVM emits .loc directives producing a single line table. Line tables have an implicit directory (index 0) equal to the compilation directory (DW_AT_comp_dir) of the compilation unit that references them. If multiple compilation units (with possibly disparate compilation directories) reference the same line table, we must avoid relying on this ambiguous directory. Achieve this my simply not setting the compilation directory on the line table when we're in this situation (multiple units while emitting assembly). llvm-svn: 204094
* DebugInfo: Move getOrCreateSourceID from DwarfDebug to DwarfCompileUnitDavid Blaikie2014-03-171-6/+0
| | | | | | | | | | | We still do a few lookups into the line table mapping in MCContext that could be factored out into a single lookup (rather than looking it up once for the table label, once to set the compilation unit, once for each time we need a file ID, etc... ) but assembly output complicates that somewhat as we still need a virtual dispatch back to the MCAsmStreamer in that case. llvm-svn: 204092
* DebugInfo: Use MC line table file entry uniquing for non-asm input as well.David Blaikie2014-03-171-6/+0
| | | | | | | | | | | | | See r204027 for the precursor to this that applied to asm debug info. This required some non-obvious API changes to handle the case of asm output (we never go asm->asm so this didn't come up in r204027): the modification of the file/directory name by MCDwarfLineTableHeader needed to be reflected in the MCAsmStreamer caller so it could print the appropriate .file directive, so those StringRef parameters are now non-const ref (in/out) parameters rather than just const. llvm-svn: 204069
* Debug Info: Fix LTO type uniquing for C++ member declarationsAdrian Prantl2014-03-141-0/+8
| | | | | | | | | | | | | | | | based on the ODR. This adds an OdrMemberMap to DwarfDebug which is used to unique C++ member function declarations based on the unique identifier of their containing class and their mangled name. We can't use the usual DIRef mechanism here because DIScopes are indexed using their entire MDNode, including decl_file and decl_line, which need not be unique (see testcase). Prior to this change multiple redundant member function declarations would end up in the same uniqued DW_TAG_class_type. llvm-svn: 203982
* DebugInfo: Refactor emitDebugPubNames/Types into a common implementationDavid Blaikie2014-03-111-0/+5
| | | | | | | | | | I could fold the callers into their one call site, but the indirection (given how verbose choosing the section is) seemed helpful. The use of a member function pointer's a bit "tricky", but seems limited enough, the call sites are simple/clean/clear, and there's only one use. llvm-svn: 203619
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-081-6/+6
| | | | | | class. llvm-svn: 203339
* Add support for hashing location information for CU level hashes.Eric Christopher2014-03-081-3/+9
| | | | | | | Add a testcase based on sret.cpp where we can now hash the entire compile unit. llvm-svn: 203319
* Two part patch:Eric Christopher2014-03-071-0/+4
| | | | | | | | | | | | | | | First: refactor out the emission of entries into the .debug_loc section into its own routine. Second: add a new class ByteStreamer that can be used to either emit using an AsmPrinter or hash using DIEHash the series of bytes that would be emitted. Use this in all of the location emission routines for the .debug_loc section. No functional change intended outside of a few additional comments in verbose assembly. llvm-svn: 203304
* DebugInfo: Refactor high_pc/low_pc construction into reusable functionDavid Blaikie2014-03-071-0/+3
| | | | | | | For incoming improvements to inlined functions and lexical blocks suggested by Adrian Prantl in review of r203187. llvm-svn: 203263
* Constify a few things with DotDebugLocEntry.Eric Christopher2014-03-061-2/+2
| | | | llvm-svn: 203150
* [Layering] Move DebugInfo.h into the IR library where its implementationChandler Carruth2014-03-061-1/+1
| | | | | | already lives. llvm-svn: 203046
* Remove the last of the special case code for emitting attributes.Eric Christopher2014-03-061-0/+4
| | | | | | | | This works by moving the existing code into the DIEValue hierarchy and using the DwarfDebug pointer off of the AsmPrinter to access any global information we need. llvm-svn: 203033
* constify a few accessors.Eric Christopher2014-03-061-3/+3
| | | | llvm-svn: 203032
* Add a DIELocList class to handle pointers into the location list.Eric Christopher2014-03-051-0/+3
| | | | | | | | This enables us to figure out where in the debug_loc section our locations are so that we can eventually hash them. It also helps remove some special case code in emission. No functional change. llvm-svn: 203018
* [Layering] Move DebugLoc.h into the IR library. The implementationChandler Carruth2014-03-051-1/+1
| | | | | | | | | | | already lived there and it is where it belongs -- this is the in-memory debug location representation. This is just cleanup -- Modules can actually cope with this, but that doesn't make it right. After chatting with folks that have out-of-tree stuff, going ahead and moving the rest of the headers seems preferable. llvm-svn: 202960
* [cleanup] Re-sort all the includes with utils/sort_includes.py.Chandler Carruth2014-03-041-1/+1
| | | | llvm-svn: 202811
* Add a DIELoc class to cover the DW_FORM_exprloc set of expressionsEric Christopher2014-02-161-1/+1
| | | | | | | | | | | | | alongside DIEBlock and replace uses accordingly. Use DW_FORM_exprloc in DWARF4 and later code. Update testcases. Adding a DIELoc instead of using extra forms inside DIEBlock so that we can keep location expressions separate from other uses. No direct use at the moment, however, it's not a lot of code and using a separately named class keeps it somewhat more obvious what's going on in various locations. llvm-svn: 201481
* DebugInfo: Deduplicate entries in the fission address tableDavid Blaikie2014-02-151-3/+7
| | | | | | | | | | | | This broke in r185459 while TLS support was being generalized to handle non-symbol TLS representations. I thought about/tried having an enum rather than a bool to track the TLS-ness of the address table entry, but namespaces and naming seemed more hassle than it was worth for only one caller that needed to specify this. llvm-svn: 201469
* DwarfUnit: Provide a reference to a defining DwarfCompileUnit from ↵David Blaikie2014-02-121-2/+2
| | | | | | | | | DwarfTypeUnit. Type units need to insert their file strings into the compile unit's line/file table. This is preliminary work to that end. llvm-svn: 201196
* Make the compile unit map a MapVector so that we can assume a stableEric Christopher2014-01-291-1/+2
| | | | | | output ordering. llvm-svn: 200421
* Revert r199871 and replace it with a simple check in the debug infoEric Christopher2014-01-281-0/+4
| | | | | | | | | code to see if we're emitting a function into a non-default text section. This is still a less-than-ideal solution, but more contained than r199871 to determine whether or not we're emitting code into an array of comdat sections. llvm-svn: 200269
* Revert "Use DW_AT_high_pc and DW_AT_low_pc for the high and low pc for a"Eric Christopher2014-01-241-1/+0
| | | | | | | | in order to fix the cygwin/mingw bots. This reverts commit r199990. llvm-svn: 199991
* Use DW_AT_high_pc and DW_AT_low_pc for the high and low pc for aEric Christopher2014-01-241-0/+1
| | | | | | | | compile unit. Make these relocations on the platforms that need relocations and add a routine to ensure that we don't put the addresses in an offset table for split dwarf. llvm-svn: 199990
* Make sure we emit a relocation to the debug_ranges section in theEric Christopher2014-01-151-0/+6
| | | | | | presence of CU ranges. llvm-svn: 199276
* Revert "Revert r198851, "Prototype of skeleton type units for fission""David Blaikie2014-01-101-0/+4
| | | | | | | | | This reverts commit r198865 which reverts r198851. ASan identified a use-of-uninitialized of the DwarfTypeUnit::Ty variable in skeleton type units. llvm-svn: 198908
* Revert r198851, "Prototype of skeleton type units for fission"NAKAMURA Takumi2014-01-091-4/+0
| | | | | | It caused undefined behavior. DwarfTypeUnit::Ty might not be initialized properly, I guess. llvm-svn: 198865
* Prototype of skeleton type units for fissionDavid Blaikie2014-01-091-0/+4
| | | | llvm-svn: 198851
* DwarfDebug: Refactor out common skeleton construction code to be reused for ↵David Blaikie2014-01-091-0/+3
| | | | | | type unit skeletons. llvm-svn: 198846
* DwarfUnit: Rename "Node" to "CUNode" and propagate it through DwarfTypeUnit ↵David Blaikie2014-01-091-2/+2
| | | | | | | | | | as well. Since we'll now also need the split dwarf file name along with the language in DwarfTypeUnits, just use the whole DICompileUnit rather than explicitly handling each field needed. llvm-svn: 198842
* Revert "Revert "Debug Info: Type Units: Simplify type hashing using ↵David Blaikie2014-01-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | IR-provided unique names."" This reverts commit r198398, thus reapplying r198397. I had accidentally introduced an endianness issue when applying the hash to the type unit. Using support::ulittle64_t in the reinterpret_cast in addDwarfTypeUnitType fixes this issue. Original commit message: Debug Info: Type Units: Simplify type hashing using IR-provided unique names. What's good for LTO metadata size problems ought to be good for non-LTO debug info size too, so let's rely on the same uniqueness in both cases. If it's insufficient for non-LTO for whatever reason (since we now won't be uniquing CU-local types or any C types - but these are likely to not be the most significant contributors to type bloat) we should consider a frontend solution that'll help both LTO and non-LTO alike, rather than using DWARF-level DIE-hashing that only helps non-LTO debug info size. It's also much simpler this way and benefits C++ even more since we can deduplicate lexically separate definitions of the same C++ type since they have the same mangled name. llvm-svn: 198436
* Revert "Debug Info: Type Units: Simplify type hashing using IR-provided ↵David Blaikie2014-01-031-2/+1
| | | | | | | | | | | unique names." Reverting due to bot failure I won't have time to investigate until tomorrow. This reverts commit r198397. llvm-svn: 198398
* Debug Info: Type Units: Simplify type hashing using IR-provided unique names.David Blaikie2014-01-031-1/+2
| | | | | | | | | | | | | | | | What's good for LTO metadata size problems ought to be good for non-LTO debug info size too, so let's rely on the same uniqueness in both cases. If it's insufficient for non-LTO for whatever reason (since we now won't be uniquing CU-local types or any C types - but these are likely to not be the most significant contributors to type bloat) we should consider a frontend solution that'll help both LTO and non-LTO alike, rather than using DWARF-level DIE-hashing that only helps non-LTO debug info size. It's also much simpler this way and benefits C++ even more since we can deduplicate lexically separate definitions of the same C++ type since they have the same mangled name. llvm-svn: 198397
* Revert r198208 and reapply:Eric Christopher2013-12-301-1/+2
| | | | | | | | | | r198196: Use a pointer to keep track of the skeleton unit for each normal unit and construct it up front. r198199: Reapply r198196 with a fix to zero initialize the skeleton pointer. r198202: Fix aranges and split dwarf by ensuring that the symbol and relocation back to the compile unit from the aranges section is to the skeleton unit and not the one in the dwo. with a fix to use integer 0 for DW_AT_low_pc since the relocation to the text section symbol was causing issues with COFF. Accordingly remove addLocalLabelAddress and machinery since we're not currently using it. llvm-svn: 198222
* Revert r198199 (and r198202). It broke 3 DebugInfo tests for targeting ↵NAKAMURA Takumi2013-12-301-2/+1
| | | | | | | | | | | | | | i686-cygming. r198196: Use a pointer to keep track of the skeleton unit for each normal unit and construct it up front. r198199: Reapply r198196 with a fix to zero initialize the skeleton pointer. r198202: Fix aranges and split dwarf by ensuring that the symbol and relocation back to the compile unit from the aranges section is to the skeleton unit and not the one in the dwo. They could be reproducible with explicit target. llvm/lib/MC/WinCOFFObjectWriter.cpp:224: bool {anonymous}::COFFSymbol::should_keep() const: Assertion `Section->Number != -1 && "Sections with relocations must be real!"' failed. llvm-svn: 198208
* Fix aranges and split dwarf by ensuring that the symbol and relocationEric Christopher2013-12-301-1/+2
| | | | | | | | | | | back to the compile unit from the aranges section is to the skeleton unit and not the one in the dwo. Do this by adding a method to grab a forwarded on local sym and local section by querying the skeleton if one exists and using that. Add a few tests to verify the relocations are back to the correct section. llvm-svn: 198202
* DebugInfo: Introduce new DIValue, DIETypeSignature to encode references to ↵David Blaikie2013-12-171-7/+3
| | | | | | | | | type units via their signatures This simplifies type unit and type unit reference creation as well as setting the stage for inter-type hashing across type unit boundaries. llvm-svn: 197539
* We never emit info into the macro info section, stop emitting anEric Christopher2013-12-101-3/+0
| | | | | | empty one. llvm-svn: 196849
* Rename CompileUnit->DwarfCompileUnit and TypeUnit->DwarfTypeUnit forEric Christopher2013-12-091-26/+26
| | | | | | clarity. No functional change. llvm-svn: 196844
* Rename Unit->DwarfUnit to match the file name and make it a bit lessEric Christopher2013-12-091-63/+64
| | | | | | ambiguous. Reformat to match. llvm-svn: 196838
* DebugInfo: Include the section and start-of-section label in the unitDavid Blaikie2013-12-061-2/+2
| | | | | | | This is a precursor to moving type units into the correct (debug_types) section with comdat groups and full type unit headers. llvm-svn: 196615
* DebugInfo: Ensure unit IDs (for non-skeletal units) match thein index in the ↵David Blaikie2013-12-061-3/+0
| | | | | | | | | | | | | | | | | | | list This simplifies reasoning about the code and enables simple navigation from a skeleton to its full unit. (currently there are no type unit skeletons, so the skeleton list doesn't have the same ID == index property) Eventually we should get rid of this ID and just store the labels we need as the IDs are allowing this code to create difficult to manage/understand associations (loops over non-skeletal units are implicitly referencing their skeletal units during pub* emission, for example). It may be necessary to have some kind of skeleton->full unit association and a more direct pointer or similar device would be preferable than an index. llvm-svn: 196600
* Rename DwarfUnits to DwarfFile to help avoid some naming confusion.Eric Christopher2013-12-051-6/+7
| | | | llvm-svn: 196519
* DwarfDebug/DwarfUnit: Push abbreviation structures down into DwarfUnits to ↵David Blaikie2013-12-051-23/+8
| | | | | | reduce duplication llvm-svn: 196479
* DwarfDebug: Avoid unnecessary abbreviation lookup when emitting DIEsDavid Blaikie2013-12-051-1/+1
| | | | | | | DIEs already contain references directly to their DIEAbbrev, use that instead of looking it up based on index. llvm-svn: 196446
OpenPOWER on IntegriCloud