summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove the intermediate AccelObjC maps in DWARF unitsDavid Blaikie2014-04-241-0/+3
| | | | llvm-svn: 207057
* Remove intermediate accelerator table for names.David Blaikie2014-04-231-0/+7
| | | | | | (similar changes coming for the other accelerator tables) llvm-svn: 207049
* Move the AddressPool from DwarfFile to DwarfDebug.David Blaikie2014-04-231-0/+4
| | | | | | | | | There's only ever one address pool, not one per DWARF output file, so let's just have one. (similar refactoring of the string pool to come soon) llvm-svn: 207026
* Split out DwarfFile from DwarfDebug into its own .h/.cpp files.David Blaikie2014-04-231-90/+1
| | | | | | | | Some of these types (DwarfDebug in particular) are quite large to begin with (and I keep forgetting whether DwarfFile is in DwarfDebug or DwarfUnit... ) so having a few smaller files seems like goodness. llvm-svn: 207010
* Push memory ownership of DwarfUnits into clients of DwarfFile.David Blaikie2014-04-221-17/+20
| | | | | | | | | | | | This prompted me to push references through most of DwarfDebug. Sorry for the churn. Honestly it's a bit silly that we're passing around units all over the place like that anyway and I think it's mostly due to the DIE attribute adding utility functions being utilities in DwarfUnit. I should have another go at moving them out of DwarfUnit... llvm-svn: 206925
* Use std::unique_ptr to handle ownership of DwarfUnits in DwarfFile.David Blaikie2014-04-221-6/+5
| | | | | | | So Chandler - how about those range algorithms? (would really love a dereferencing range adapter for this sort of stuff) llvm-svn: 206921
* Simplify address pool index assignment.David Blaikie2014-04-221-3/+1
| | | | llvm-svn: 206905
* Revert "Use value semantics to manage DbgVariables rather than dynamic ↵David Blaikie2014-04-221-12/+4
| | | | | | | | | | | allocation/pointers." This reverts commit r206780. This commit was regressing gdb.opt/inline-locals.exp in the GDB 7.5 test suite. Reverting until I can fix the issue. llvm-svn: 206867
* Use value semantics to manage DbgVariables rather than dynamic ↵David Blaikie2014-04-211-4/+12
| | | | | | | | | | allocation/pointers. Requires switching some vectors to lists to maintain pointer validity. These could be changed to forward_lists (singly linked) with a bit more work - I've left comments to that effect. llvm-svn: 206780
* Use std::unique_ptr for DIE childrenDavid Blaikie2014-04-141-2/+2
| | | | | | | | | Got bored, removed some manual memory management. Pushed references (rather than pointers) through a few APIs rather than replacing *x with x.get(). llvm-svn: 206222
* Use dwarf::Tag rather than unsigned for DIE::Tag to make debugging easier.David Blaikie2014-04-121-1/+1
| | | | | | | | | | | Nice to be able to just print out the Tag and have the debugger print dwarf::DW_TAG_subprogram or whatever, rather than an int. It's a bit finicky (for example DIDescriptor::getTag still returns unsigned) because some places still handle real dwarf tags + our fake tags (one day we'll remove the fake tags, hopefully). llvm-svn: 206098
* Split debug_loc and debug_loc.dwo emission into two separate functionsDavid Blaikie2014-04-021-0/+3
| | | | | | Based on code review feedback from Eric Christopher on r204697 llvm-svn: 205385
* DebugInfo: Introduce DebugLocList to encapsulate a list of DebugLocEntries ↵David Blaikie2014-04-021-3/+5
| | | | | | | | | | | | and an MC Label to refer to them This removes the magic-number-esque code creating/retrieving the same label for a debug_loc entry from two places and removes the last small piece of reusable logic from emitDebugLoc so that there will be less duplication when refactoring it into two functions (one for debug_loc, the other for debug_loc.dwo). llvm-svn: 205382
* DebugInfo: Split DebugLocEntry into its own file.David Blaikie2014-04-011-85/+1
| | | | | | | It seems big enough that it deserves its own file - but it is header only, so there's no need for another cpp file, etc. llvm-svn: 205360
* DwarfDebug: Prevent DebugLocEntry merging from coalescing two differentAdrian Prantl2014-04-011-2/+9
| | | | | | | | constants into only the first one. rdar://14874886. llvm-svn: 205357
* DebugInfo: Factor out common functionality for rendering debug_loc and ↵David Blaikie2014-04-011-0/+3
| | | | | | | | | debug_loc.dwo location list entries In preparation for refactoring this function into two, one for debug_loc, one for debug_loc.dwo. llvm-svn: 205324
* Simplify debug_loc.dwo handling slightly.David Blaikie2014-04-011-4/+1
| | | | llvm-svn: 205322
* DebugInfo: Support debug_loc under fissionDavid Blaikie2014-03-251-1/+4
| | | | | | | | | | | | | | | | | | | | | | Implement debug_loc.dwo, as well as llvm-dwarfdump support for dumping this section. Outlined in the DWARF5 spec and http://gcc.gnu.org/wiki/DebugFission the debug_loc.dwo section has more variation than the standard debug_loc, allowing 3 different forms of entry (plus the end of list entry). GCC seems to, and Clang certainly, only use one form, so I've just implemented dumping support for that for now. It wasn't immediately obvious that there was a good refactoring to share the implementation of dumping support between debug_loc and debug_loc.dwo, so they're separate for now - ideas welcome or I may come back to it at some point. As per a comment in the code, we could choose different forms that may reduce the number of debug_addr entries we emit, but that will require further study. llvm-svn: 204697
* DebugInfo: Simplify debug loc list handling by keeping separate listsDavid Blaikie2014-03-241-2/+3
| | | | | | | Rather than using a flat list with "empty" entries (ala the actual on-disk format), keep separate lists for each variable. llvm-svn: 204680
* DwarfDebug: Simplify debug_loc mergingDavid Blaikie2014-03-241-14/+10
| | | | | | | | | | 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). llvm-svn: 204679
* DwarfDebug: Remove an unused parameterDavid Blaikie2014-03-241-2/+1
| | | | llvm-svn: 204665
* Typo.Eric Christopher2014-03-201-1/+1
| | | | llvm-svn: 204378
* Reapply DW_AT_low/high_pc patch:Eric Christopher2014-03-201-12/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 204377
* Revert "Use the range machinery for DW_AT_ranges and DW_AT_high/lo_pc."Eric Christopher2014-03-201-13/+3
| | | | | | | | This appears to trigger failures with optimization and function arguments somehow. This reverts commit r204277. llvm-svn: 204286
* Use the range machinery for DW_AT_ranges and DW_AT_high/lo_pc.Eric Christopher2014-03-191-3/+13
| | | | | | | | | | | | | | | | | | 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. llvm-svn: 204277
* DebugInfo: Use the comp_dir of the referencing type units when building ↵David Blaikie2014-03-191-4/+11
| | | | | | | | | | | | 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. llvm-svn: 204202
* Add back the headers we're getting via (likely) transitive includes.Eric Christopher2014-03-181-0/+4
| | | | | | We really do use these things in the header. llvm-svn: 204180
* Fix for coding style.Eric Christopher2014-03-181-1/+1
| | | | llvm-svn: 204177
* Remove a bunch of unnecessary includes and forward declarations.Eric Christopher2014-03-181-17/+4
| | | | llvm-svn: 204176
* 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
OpenPOWER on IntegriCloud