summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "DebugInfo: Don't put fission type units in comdat sections."David Blaikie2014-05-211-4/+0
| | | | | | | | | This reverts commit r208930, r208933, and r208975. It seems not all fission consumers are ready to handle this behavior. Reverting until tools are brought up to spec. llvm-svn: 209338
* DebugInfo: Follow up to r208930, comment usage of 'using' to bring in base ↵David Blaikie2014-05-151-0/+3
| | | | | | | | class overload. Code review feedback from Eric Christopher. llvm-svn: 208933
* DebugInfo: Don't put fission type units in comdat sections.David Blaikie2014-05-151-0/+1
| | | | | | | | | Since type units in the dwo file are handled by a debug aware tool, they don't need to leverage the ELF comdat grouping to implement deduplication. Avoid creating all the .group sections for these as a space optimization. llvm-svn: 208930
* DwarfUnit: Pick a winner between isTypeSigned and isUnsignedDIType.David Blaikie2014-05-111-1/+1
| | | | | | | | | And the winner by a nose is isUnsignedDIType, for no particular reason. These two functions were just complements of each other and used in very related code, so refactor callers to just use one of them. llvm-svn: 208500
* DwarfUnit: Factor out calling isUnsignedDIType into a utility function so ↵David Blaikie2014-05-111-1/+2
| | | | | | each caller of emitConstantValue doesn't have to call it separately. llvm-svn: 208496
* DwarfUnit: Share common constant value emission between APInts of small (<= ↵David Blaikie2014-05-111-0/+1
| | | | | | | | | | | | 64 bit) and MCOperand immediates. Doesn't seem a good reason to duplicate this code (it was more literally duplicated prior to r208494, and while the dataN code /does/ actually fire in this case, it doesn't seem necessary (and the DWARF standard recommends using udata/sdata pervasively instead of dataN, so as to indicate signedness of the values)) llvm-svn: 208495
* Revert "Emit DW_AT_object_pointer once, on the declaration, for each function."David Blaikie2014-04-301-1/+1
| | | | | | | | | | | | | | Breaks GDB buildbot (http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/14517) GCC emits DW_AT_object_pointer /everywhere/ (declaration, abstract definition, inlined subroutine), but it looks like GCC relies on it being somewhere other than the declaration, at least. I'll experiment further & can hopefully still remove it from the inlined_subroutine. This reverts commit r207705. llvm-svn: 207719
* DebugInfo: Omit DW_AT_artificial on DW_TAG_formal_parameters in ↵David Blaikie2014-04-301-2/+4
| | | | | | | | | | | | DW_TAG_inlined_subroutines. They just don't need to be there - they're inherited from the abstract definition. In theory I would like them to be inherited from the declaration, but the DWARF standard doesn't quite say that... we can probably do it anyway but I'm less confident about that so I'll leave it for a separate commit. llvm-svn: 207717
* Emit DW_AT_object_pointer once, on the declaration, for each function.David Blaikie2014-04-301-1/+1
| | | | | | | | | | | | | | | | This effectively reverts r164326, but adds some comments and justification and ensures we /don't/ emit the DW_AT_object_pointer on the (abstract and concrete) definitions. (while still preserving it on standalone definitions involving ObjC Blocks) This does increase the size of member function declarations from 7 to 11 bytes, unfortunately, but still seems like the Right Thing to do so that callers that see only the declaration still have the information about the object pointer. That said, I don't know what, if any, DWARF consumers don't have a heuristic to guess this in the case of normal C++ member functions - perhaps we can remove it entirely. llvm-svn: 207705
* Remove DwarfUnit::LabelRange since it's unused.David Blaikie2014-04-281-9/+0
| | | | | | | | | | | Seems at some point the intent was to emit fission ranges_base as unique per CU but the code today emits ranges_base as the start of the ranges section for all CUs being compiled and all the ranges_base relative addresses are relative to that. So removing this dead code and leaving the status quo until there's a reason to change it (perhaps something's faster if it has distinct ranges for each CU). llvm-svn: 207464
* DebugInfo: Just store the DIE by value in the DwarfUnitDavid Blaikie2014-04-281-9/+9
| | | | | | | | | Since all 4 ctor calls in DwarfDebug just pass in a trivially constructed DIE with the right tag type, sink the tag selection down into the Dwarf*Unit ctors (removing the argument entirely from callers in DwarfDebug) and initialize the DIE member in DwarfUnit. llvm-svn: 207448
* Pass DIEs to DwarfUnit constructors by unique_ptr.David Blaikie2014-04-281-6/+6
| | | | llvm-svn: 207447
* DWARF Type Units: Avoid emitting type units under fission if the type ↵David Blaikie2014-04-261-3/+3
| | | | | | | | | | | | requires an address. Since there's no way to ensure the type unit in the .dwo and the type unit skeleton in the .o are correlated, this cannot work. This implementation is a bit inefficient for a few reasons, called out in comments. llvm-svn: 207323
* DwarfUnit: Remove unused functionDavid Blaikie2014-04-251-4/+0
| | | | llvm-svn: 207264
* DIE: Pass ownership of children via std::unique_ptr rather than raw pointer.David Blaikie2014-04-251-3/+5
| | | | | | | | | | | This should reduce the chance of memory leaks like those fixed in r207240. There's still some unclear ownership of DIEs happening in DwarfDebug. Pushing unique_ptr and references through more APIs should help expose the cases where ownership is a bit fuzzy. llvm-svn: 207263
* DIEEntry: Refer to the specified DIE via reference rather than pointer.David Blaikie2014-04-251-2/+2
| | | | | | | Makes some more cases (the unit tests, specifically), lexically compatible with a change to unique_ptr. llvm-svn: 207261
* DwarfUnit: return by reference from createAndAddDIEDavid Blaikie2014-04-251-2/+2
| | | | | | | Since this doesn't return ownership (the DIE has been added to the specified parent already) nor return null, just return by reference. llvm-svn: 207259
* Return DIE by reference instead of pointer from DwarfUnit::getUnitDieDavid Blaikie2014-04-251-1/+1
| | | | llvm-svn: 207255
* DwarfUnit: Suddently, DIE references, everywhere.David Blaikie2014-04-251-44/+44
| | | | | | | | This'll make changing to unique_ptr ownership of DIEs easier since the usages will now have '*' on them making them textually compatible between unique_ptr and raw pointer. llvm-svn: 207253
* Refactor some common logic in DwarfUnit::constructVariableDIE and pass ↵David Blaikie2014-04-251-0/+4
| | | | | | non-null DIE by reference to DbgVariable::setDIE llvm-svn: 207244
* Remove the intermediate AccelTypes maps in DWARF units.David Blaikie2014-04-241-11/+0
| | | | llvm-svn: 207060
* Remove the intermediate AccelNamespace maps in DWARF units.David Blaikie2014-04-241-6/+0
| | | | llvm-svn: 207059
* Remove the intermediate AccelObjC maps in DWARF unitsDavid Blaikie2014-04-241-9/+0
| | | | llvm-svn: 207057
* And actually use the DwarfDebug::AccelNames to emit the names.David Blaikie2014-04-231-6/+0
| | | | | | Fix for r207049 which would've emitted no accelerated names at all... llvm-svn: 207051
* Remove intermediate accelerator table for names.David Blaikie2014-04-231-3/+0
| | | | | | (similar changes coming for the other accelerator tables) llvm-svn: 207049
* Push memory ownership of DwarfUnits into clients of DwarfFile.David Blaikie2014-04-221-1/+1
| | | | | | | | | | | | 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
* Remove unused parameterDavid Blaikie2014-03-241-4/+2
| | | | llvm-svn: 204663
* Reapply DW_AT_low/high_pc patch:Eric Christopher2014-03-201-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-9/+6
| | | | | | | | 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-6/+9
| | | | | | | | | | | | | | | | | | 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
* Debug info: Remove OdrMemberMap from DwarfDebug, it's not necessary.Adrian Prantl2014-03-181-22/+0
| | | | | | Follow-up to r203982. llvm-svn: 204162
* Replace unnecessary #include directive with forward declarations.Adrian Prantl2014-03-181-0/+1
| | | | llvm-svn: 204104
* DebugInfo: Avoid emitting standard opcode lengths in debug_line.dwo headers ↵David Blaikie2014-03-181-2/+2
| | | | | | | | | 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-4/+12
| | | | | | | | | | | | | | | | | | | | -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: Move getOrCreateSourceID from DwarfDebug to DwarfCompileUnitDavid Blaikie2014-03-171-0/+4
| | | | | | | | | | | 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
* Debug Info: Fix LTO type uniquing for C++ member declarationsAdrian Prantl2014-03-141-0/+22
| | | | | | | | | | | | | | | | 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: Emit DW_TAG_subprogram's DW_AT_high_pc as an offset from the low_pcDavid Blaikie2014-03-071-0/+4
| | | | | | | This removes a relocation from each subprogram, reducing link times, etc. llvm-svn: 203187
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-2/+1
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* [Layering] Move DebugInfo.h into the IR library where its implementationChandler Carruth2014-03-061-1/+1
| | | | | | already lives. llvm-svn: 203046
* [Layering] Move DIBuilder.h into the IR library where its implementationChandler Carruth2014-03-061-1/+1
| | | | | | already lives. llvm-svn: 203038
* 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
* [cleanup] Re-sort all the includes with utils/sort_includes.py.Chandler Carruth2014-03-041-1/+1
| | | | llvm-svn: 202811
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-021-4/+4
| | | | llvm-svn: 202621
* If we're only emitting line tables for a particular CU then don't addEric Christopher2014-02-271-1/+6
| | | | | | | | | | | any ranges to the list of ranges for the CU as we don't want to emit them anyway. This ensures that we will still emit ranges if we have a compile unit compiled with only line tables and one compiled with full debug info requested (we'll emit for the one with full debug info). Update testcase metadata accordingly to continue emitting ranges. llvm-svn: 202333
* Address review comments for r202188.Adrian Prantl2014-02-251-3/+3
| | | | | | | | | This is refactoring / simplifying code, updating comments and enabling the testcase on non-x86 platforms. No functionality change. llvm-svn: 202199
* Debug info: Support variadic functions.Adrian Prantl2014-02-251-0/+3
| | | | | | | | | | | | | | Variadic functions have an unspecified parameter tag after the last argument. In IR this is represented as an unspecified parameter in the subroutine type. Paired commit with CFE r202185. rdar://problem/13690847 This re-applies r202184 + a bugfix in DwarfDebug's argument handling. llvm-svn: 202188
* Revert "Debug info: Support variadic functions."Adrian Prantl2014-02-251-3/+0
| | | | | | This reverts commit r202184 because of buildbot breakage. llvm-svn: 202187
* Debug info: Support variadic functions.Adrian Prantl2014-02-251-0/+3
| | | | | | | | | | | | Variadic functions have an unspecified parameter tag after the last argument. In IR this is represented as an unspecified parameter in the subroutine type. Paired commit with CFE. rdar://problem/13690847 llvm-svn: 202184
* Add a DIELoc class to cover the DW_FORM_exprloc set of expressionsEric Christopher2014-02-161-9/+15
| | | | | | | | | | | | | 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: Implement DW_AT_stmt_list for type unitsDavid Blaikie2014-02-141-0/+7
| | | | | | | | | Type units will share the statement list of their defining compile unit. This is a tradeoff that reduces .o debug info size at the cost of some linked debug info size (since the contents of those string tables won't be deduplicated along with the type unit) which seems right for now. llvm-svn: 201445
OpenPOWER on IntegriCloud