summaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DwarfDebug.h
Commit message (Collapse)AuthorAge
...
* DebugInfo: Simplify debug loc list handling by keeping separate listsDavid Blaikie2014-03-24
| | | | | | | Rather than using a flat list with "empty" entries (ala the actual on-disk format), keep separate lists for each variable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204680 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfDebug: Simplify debug_loc mergingDavid Blaikie2014-03-24
| | | | | | | | | | No functional change intended. Merging up-front rather than delaying this task until later. This just seems simpler and more efficient (avoiding growing the debug loc list only to have to skip over those post-merged entries, etc). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204679 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfDebug: Remove an unused parameterDavid Blaikie2014-03-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204665 91177308-0d34-0410-b5e6-96231b3b80d8
* Typo.Eric Christopher2014-03-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204378 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply DW_AT_low/high_pc patch:Eric Christopher2014-03-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the range machinery for DW_AT_ranges and DW_AT_high/lo_pc. This commit moves us from a single range per subprogram to extending ranges if we are: a) In the same section, and b) In the same enclosing CU. This means we have more fine grained ranges for compile units, and fewer ranges overall when we have multiple functions in the same CU adjacent to each other in the object file. Also remove all of the earlier hacks around this functionality for function sections etc. Also update all of the testcases to take into account the merging functionality. with a fix for location entries in the debug_loc section: Make sure that debug loc entries are relative to the low_pc of the compile unit. This means that when we only have a single range that the offset should be just relative to the low_pc of the unit, for multiple ranges for a CU this means that we'll be relative to 0 which we emit along with DW_AT_ranges. This mostly shows up with linked binaries, so add a testcase with multiple CUs so that our location is going to be offset of a CU with a non-zero low_pc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204377 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Use the range machinery for DW_AT_ranges and DW_AT_high/lo_pc."Eric Christopher2014-03-20
| | | | | | | | This appears to trigger failures with optimization and function arguments somehow. This reverts commit r204277. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204286 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the range machinery for DW_AT_ranges and DW_AT_high/lo_pc.Eric Christopher2014-03-19
| | | | | | | | | | | | | | | | | | This commit moves us from a single range per subprogram to extending ranges if we are: a) In the same section, and b) In the same enclosing CU. This means we have more fine grained ranges for compile units, and fewer ranges overall when we have multiple functions in the same CU adjacent to each other in the object file. Also remove all of the earlier hacks around this functionality for function sections etc. Also update all of the testcases to take into account the merging functionality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204277 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Use the comp_dir of the referencing type units when building ↵David Blaikie2014-03-19
| | | | | | | | | | | | debug_line.dwo This isn't a complete fix - it falls back to non-comp_dir when multiple compile units are in play. Adding a map of comp_dir to table is part of the more general solution, but I gave up (in the short term) when I realized I'd also have to calculate the size of each type unit so as to produce correct DW_AT_stmt_list attributes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204202 91177308-0d34-0410-b5e6-96231b3b80d8
* Add back the headers we're getting via (likely) transitive includes.Eric Christopher2014-03-18
| | | | | | We really do use these things in the header. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204180 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for coding style.Eric Christopher2014-03-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204177 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a bunch of unnecessary includes and forward declarations.Eric Christopher2014-03-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204176 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug info: Remove OdrMemberMap from DwarfDebug, it's not necessary.Adrian Prantl2014-03-18
| | | | | | Follow-up to r203982. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204162 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch the type field in DIVariable and DIGlobalVariable over to DITypeRefs.Adrian Prantl2014-03-18
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204106 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace unnecessary #include directive with forward declarations.Adrian Prantl2014-03-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204104 91177308-0d34-0410-b5e6-96231b3b80d8
* Shorten DotDebugLocEntry to just DebugLocEntry and reformat.Eric Christopher2014-03-18
| | | | | | No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204102 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Avoid emitting standard opcode lengths in debug_line.dwo headers ↵David Blaikie2014-03-18
| | | | | | | | | where opcodes are never used anyway Introduce a slightly tighter wrapper around the header structure that handles this use case. (MCDwarfDwoLineTable) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204101 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Implement debug_line.dwo for file names used in type units during ↵David Blaikie2014-03-18
| | | | | | | | | | | | | | | | | | | | -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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204099 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Do not rely on the compilation dir (index 0) for files in line ↵David Blaikie2014-03-18
| | | | | | | | | | | | | | | | | | | | | | 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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204094 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Move getOrCreateSourceID from DwarfDebug to DwarfCompileUnitDavid Blaikie2014-03-17
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204092 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Use MC line table file entry uniquing for non-asm input as well.David Blaikie2014-03-17
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204069 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: Fix LTO type uniquing for C++ member declarationsAdrian Prantl2014-03-14
| | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203982 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Refactor emitDebugPubNames/Types into a common implementationDavid Blaikie2014-03-11
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203619 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-08
| | | | | | class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203339 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for hashing location information for CU level hashes.Eric Christopher2014-03-08
| | | | | | | Add a testcase based on sret.cpp where we can now hash the entire compile unit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203319 91177308-0d34-0410-b5e6-96231b3b80d8
* Two part patch:Eric Christopher2014-03-07
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203304 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Refactor high_pc/low_pc construction into reusable functionDavid Blaikie2014-03-07
| | | | | | | For incoming improvements to inlined functions and lexical blocks suggested by Adrian Prantl in review of r203187. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203263 91177308-0d34-0410-b5e6-96231b3b80d8
* Constify a few things with DotDebugLocEntry.Eric Christopher2014-03-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203150 91177308-0d34-0410-b5e6-96231b3b80d8
* [Layering] Move DebugInfo.h into the IR library where its implementationChandler Carruth2014-03-06
| | | | | | already lives. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203046 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the last of the special case code for emitting attributes.Eric Christopher2014-03-06
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203033 91177308-0d34-0410-b5e6-96231b3b80d8
* constify a few accessors.Eric Christopher2014-03-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203032 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a DIELocList class to handle pointers into the location list.Eric Christopher2014-03-05
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203018 91177308-0d34-0410-b5e6-96231b3b80d8
* [Layering] Move DebugLoc.h into the IR library. The implementationChandler Carruth2014-03-05
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202960 91177308-0d34-0410-b5e6-96231b3b80d8
* [cleanup] Re-sort all the includes with utils/sort_includes.py.Chandler Carruth2014-03-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202811 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a DIELoc class to cover the DW_FORM_exprloc set of expressionsEric Christopher2014-02-16
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201481 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Deduplicate entries in the fission address tableDavid Blaikie2014-02-15
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201469 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfUnit: Provide a reference to a defining DwarfCompileUnit from ↵David Blaikie2014-02-12
| | | | | | | | | DwarfTypeUnit. Type units need to insert their file strings into the compile unit's line/file table. This is preliminary work to that end. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201196 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the compile unit map a MapVector so that we can assume a stableEric Christopher2014-01-29
| | | | | | output ordering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200421 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r199871 and replace it with a simple check in the debug infoEric Christopher2014-01-28
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200269 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Use DW_AT_high_pc and DW_AT_low_pc for the high and low pc for a"Eric Christopher2014-01-24
| | | | | | | | in order to fix the cygwin/mingw bots. This reverts commit r199990. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199991 91177308-0d34-0410-b5e6-96231b3b80d8
* Use DW_AT_high_pc and DW_AT_low_pc for the high and low pc for aEric Christopher2014-01-24
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199990 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure we emit a relocation to the debug_ranges section in theEric Christopher2014-01-15
| | | | | | presence of CU ranges. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199276 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Revert r198851, "Prototype of skeleton type units for fission""David Blaikie2014-01-10
| | | | | | | | | This reverts commit r198865 which reverts r198851. ASan identified a use-of-uninitialized of the DwarfTypeUnit::Ty variable in skeleton type units. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198908 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r198851, "Prototype of skeleton type units for fission"NAKAMURA Takumi2014-01-09
| | | | | | It caused undefined behavior. DwarfTypeUnit::Ty might not be initialized properly, I guess. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198865 91177308-0d34-0410-b5e6-96231b3b80d8
* Prototype of skeleton type units for fissionDavid Blaikie2014-01-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198851 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfDebug: Refactor out common skeleton construction code to be reused for ↵David Blaikie2014-01-09
| | | | | | type unit skeletons. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198846 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfUnit: Rename "Node" to "CUNode" and propagate it through DwarfTypeUnit ↵David Blaikie2014-01-09
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198842 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Revert "Debug Info: Type Units: Simplify type hashing using ↵David Blaikie2014-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198436 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Debug Info: Type Units: Simplify type hashing using IR-provided ↵David Blaikie2014-01-03
| | | | | | | | | | | unique names." Reverting due to bot failure I won't have time to investigate until tomorrow. This reverts commit r198397. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198398 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: Type Units: Simplify type hashing using IR-provided unique names.David Blaikie2014-01-03
| | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198397 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r198208 and reapply:Eric Christopher2013-12-30
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198222 91177308-0d34-0410-b5e6-96231b3b80d8