summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DIE.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Re-sort includes with sort-includes.py and insert raw_ostream.h where it's used.Benjamin Kramer2015-03-231-0/+1
| | | | llvm-svn: 232998
* Emit the offset directly instead of creating a dummy expression.Rafael Espindola2015-03-171-26/+1
| | | | | | | | We were creating an expression of the form (S+C)-S which is just C. Patch by Frédéric Riss. I just added the testcase. llvm-svn: 232549
* Store an optional section start label in MCSection.Rafael Espindola2015-03-101-2/+2
| | | | | | | | | | | | This makes code that uses section relative expressions (debug info) simpler and less brittle. This is still a bit awkward as the symbol is created late and has to be stored in a mutable field. I will move the symbol creation earlier in the next patch. llvm-svn: 231802
* Remove useless break after return.Frederic Riss2015-03-051-1/+0
| | | | | | Pointed out by Paul Robinson. llvm-svn: 231353
* Teach DIEInteger to emit FORM_strp and FORM_ref_addr attributes.Frederic Riss2015-03-041-0/+10
| | | | | | | | To be used/tested by llvm-dsymutil. (llvm-dsymutil does a 'static' link, no need for relocations for most things, so it'll just emit raw integers for most attributes) llvm-svn: 231298
* Constify AsmPrinter passed to DIE methods.Frederic Riss2015-03-041-22/+22
| | | | llvm-svn: 231209
* [cleanup] Re-sort all the #include lines in LLVM usingChandler Carruth2015-01-141-1/+0
| | | | | | | | | | | utils/sort_includes.py. I clearly haven't done this in a while, so more changed than usual. This even uncovered a missing include from the InstrProf library that I've added. No functionality changed here, just mechanical cleanup of the include order. llvm-svn: 225974
* Make DIE.h a public CodeGen header.Frederic Riss2015-01-051-1/+1
| | | | | | | | | | | | | | dsymutil would like to use all the AsmPrinter/MCStreamer infrastructure to stream out the DWARF. In order to do so, it will reuse the DIE object and so this header needs to be public. The interface exposed here has some corners that cannot be used without a DwarfDebug object, but clients that want to stream Dwarf can just avoid these. Differential Revision: http://reviews.llvm.org/D6695 llvm-svn: 225208
* Make AsmPrinter::EmitLabelOffsetDifference a static helper and simplify.Rafael Espindola2014-10-211-3/+27
| | | | | | It had exactly one caller in a position where we know hasSetDirective is true. llvm-svn: 220250
* Move DwarfCompileUnit from DwarfUnit.h to its own header (DwarfCompileUnit.h)David Blaikie2014-10-041-0/+2
| | | | | | | | | | | | In preparation for sinking all the subprogram emission code down from DwarfDebug into DwarfCompileUnit, this will avoid bloating DwarfUnit.h/cpp greatly and make concerns a bit more clear/isolated. (sinking this handling down is part of the work to handle emitting minimal subprograms for -gmlt-like data into the skeleton CU under fission) llvm-svn: 219057
* DIEEntry: Refer to the specified DIE via reference rather than pointer.David Blaikie2014-04-251-4/+4
| | | | | | | Makes some more cases (the unit tests, specifically), lexically compatible with a change to unique_ptr. llvm-svn: 207261
* [C++] Use 'nullptr'.Craig Topper2014-04-241-2/+2
| | | | llvm-svn: 207083
* Use std::unique_ptr for DIE childrenDavid Blaikie2014-04-141-9/+0
| | | | | | | | | 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
* DebugInfo: Introduce DebugLocList to encapsulate a list of DebugLocEntries ↵David Blaikie2014-04-021-1/+1
| | | | | | | | | | | | 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
* Simplify debug_loc.dwo handling slightly.David Blaikie2014-04-011-3/+1
| | | | llvm-svn: 205322
* DebugInfo: Support debug_loc under fissionDavid Blaikie2014-03-251-4/+6
| | | | | | | | | | | | | | | | | | | | | | 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
* Remove the last of the special case code for emitting attributes.Eric Christopher2014-03-061-1/+20
| | | | | | | | 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
* Add a DIELocList class to handle pointers into the location list.Eric Christopher2014-03-051-0/+31
| | | | | | | | 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
* Use a bool for whether or not an abbreviation has children rather thanEric Christopher2014-03-051-4/+4
| | | | | | | using a full uint16_t with the flag value... which happens to be 0 or 1. Update the class for bool values and rename functions slightly. llvm-svn: 202921
* Use dwarf::Attribute instead of a bare uint16_t.Eric Christopher2014-03-051-1/+1
| | | | llvm-svn: 202920
* Revert r201751 and solve the const problem a different way - byEric Christopher2014-02-271-16/+12
| | | | | | making the cache mutable. llvm-svn: 202417
* Move get[S|U]LEB128Size() to LEB128.h.Logan Chien2014-02-221-6/+7
| | | | | | | | | | This commit moves getSLEB128Size() and getULEB128Size() from MCAsmInfo to LEB128.h and removes some copy-and-paste code. Besides, this commit also adds some unit tests for the LEB128 functions. llvm-svn: 201937
* Make DIELoc/DIEBlock's ComputeSize method const. Add a setSizeEric Christopher2014-02-201-14/+18
| | | | | | | method to actually set it in the class to avoid computing it multiple times. llvm-svn: 201751
* Add a DIELoc class to cover the DW_FORM_exprloc set of expressionsEric Christopher2014-02-161-0/+55
| | | | | | | | | | | | | 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
* Remove some unused #includesEli Bendersky2014-02-011-1/+0
| | | | llvm-svn: 200611
* Use a slightly smaller hack.Rafael Espindola2014-01-161-2/+1
| | | | llvm-svn: 199363
* DebugInfo: Introduce new DIValue, DIETypeSignature to encode references to ↵David Blaikie2013-12-171-0/+17
| | | | | | | | | 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
* Reland 196270 "Generalize debug info / EH emission in AsmPrinter"Timur Iskhodzhanov2013-12-031-1/+3
| | | | | | Addressing the existense AMDGPUAsmPrinter and other subclasses of AsmPrinter llvm-svn: 196288
* Revert r196270, "Generalize debug info / EH emission in AsmPrinter"NAKAMURA Takumi2013-12-031-3/+1
| | | | | | It broke CodeGen/R600 tests with +Asserts. llvm-svn: 196272
* Generalize debug info / EH emission in AsmPrinterTimur Iskhodzhanov2013-12-031-1/+3
| | | | llvm-svn: 196270
* In Dwarf 3 (and Dwarf 2) attributes whose value are offsets into aEric Christopher2013-11-211-0/+1
| | | | | | | | | | | | | | | | | | | | | section use the form DW_FORM_data4 whilst in Dwarf 4 and later they use the form DW_FORM_sec_offset. This patch updates the places where such attributes are generated to use the appropriate form depending on the Dwarf version. The DIE entries affected have the following tags: DW_AT_stmt_list, DW_AT_ranges, DW_AT_location, DW_AT_GNU_pubnames, DW_AT_GNU_pubtypes, DW_AT_GNU_addr_base, DW_AT_GNU_ranges_base It also adds a hidden command line option "--dwarf-version=<uint>" to llc which allows the version of Dwarf to be generated to override what is specified in the metadata; this makes it possible to update existing tests to check the debugging information generated for both Dwarf 4 (the default) and Dwarf 3 using the same metadata. Patch (slightly modified) by Keith Walker! llvm-svn: 195391
* Update comment.Eric Christopher2013-11-211-2/+2
| | | | llvm-svn: 195293
* Constify the DIEs used for pubname and pubtype tables. PropagateEric Christopher2013-11-211-1/+1
| | | | | | through findAttribute etc. llvm-svn: 195290
* DebugInfo: Partial implementation of DWARF type units.David Blaikie2013-11-191-4/+7
| | | | | | | | | | | | | | Emit DW_TAG_type_units into the debug_info section using compile unit headers. This is bogus/unusable by debuggers, but testable and provides more isolated review. Subsequent patches will include support for type unit headers and emission into the debug_types section, as well as comdat grouping the types based on their hash. Also the CompileUnit type will be renamed 'Unit' and relevant portions pulled out into respective CompileUnit and TypeUnit types. llvm-svn: 195166
* Debug Info: remove duplication of DIEs when a DIE can be shared across CUs.Manman Ren2013-10-311-1/+9
| | | | | | | | | | | | | | | | | | | We add a map in DwarfDebug to map MDNodes that are shareable across CUs to the corresponding DIEs: MDTypeNodeToDieMap. These DIEs can be shared across CUs, that is why we keep the maps in DwarfDebug instead of CompileUnit. We make the assumption that if a DIE is not added to an owner yet, we assume it belongs to the current CU. Since DIEs for the type system are added to their owners immediately after creation, and other DIEs belong to the current CU, the assumption should be true. A testing case is added to show that we only create a single DIE for a type MDNode and we use ref_addr to refer to the type DIE. We also add a testing case to show ref_addr relocations for non-darwin platforms. llvm-svn: 193779
* Debug Info: support for DW_FORM_ref_addr.Manman Ren2013-10-291-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | To support ref_addr, we calculate the section offset of a DIE (i.e. offset of a DIE from beginning of the debug info section). The Offset field in DIE is currently CU-relative. To calculate the section offset, we add a DebugInfoOffset field in CompileUnit to store the offset of a CU from beginning of the debug info section. We set the value in DwarfUnits::computeSizeAndOffset for each CompileUnit. A helper function DIE::getCompileUnit is added to return the CU DIE that the input DIE belongs to. We also add a map CUDieMap in DwarfDebug to help finding the CU for a given CU DIE. For a cross-referenced DIE, we first find the CU DIE it belongs to with getCompileUnit, then we use CUDieMap to get the corresponding CU for the CU DIE. Adding the section offset of the CU with the CU-relative offset of a DIE gives us the seciton offset of the DIE. We correctly emit ref_addr with relocation using EmitLabelPlusOffset when doesDwarfUseRelocationsAcrossSections is true. This commit handles the emission of DW_FORM_ref_addr when we have an attribute with FORM_ref_addr. A follow-on patch will start using ref_addr when adding a DIEEntry. This commit will be tested and verified in the follow-on patch. Reviewed off-list by Eric, Thanks. llvm-svn: 193658
* MCStreamer: Reimplement the virtual EmitRawText as a protected member, ↵David Blaikie2013-10-241-1/+1
| | | | | | | | | | EmitRawTextImpl, to avoid string literal ambiguities Also improve the implementation of EmitRawText(Twine) so it doesn't bother using the SmallString buffer if the Twine is a simple StringRef anyway. llvm-svn: 193378
* Fix the build in DIE.cpp with MSVC 2010Reid Kleckner2013-10-211-3/+5
| | | | llvm-svn: 193106
* DebugInfo: Put each kind of constant (form, attribute, tag, etc) into its ↵David Blaikie2013-10-211-16/+17
| | | | | | | | | | | own enum for ease of use. This allows various variables to be more self-documenting and easier to debug by being of specific types without overlapping enum values. Precommit review by Eric Christopher. llvm-svn: 193091
* Temporarily revert r176882 as it needs to be implemented in a differentEric Christopher2013-10-041-12/+0
| | | | | | way for all platforms. llvm-svn: 191975
* Temporarily revert r191792 as it is causing some LTO debug failuresEric Christopher2013-10-041-9/+1
| | | | | | | on platforms with relocations in debug info and also temporarily revert r191800 due to conflicts with the revert of r191792. llvm-svn: 191967
* Debug Info: remove duplication of DIEs when a DIE is part of the type systemManman Ren2013-10-011-1/+9
| | | | | | | | | | | | | | | | | | | | | | | and it is shared across CUs. We add a few maps in DwarfDebug to map MDNodes for the type system to the corresponding DIEs: MDTypeNodeToDieMap, MDSPNodeToDieMap, and MDStaticMemberNodeToDieMap. These DIEs can be shared across CUs, that is why we keep the maps in DwarfDebug instead of CompileUnit. Sometimes, when we try to add an attribute to a DIE, the DIE is not yet added to its owner yet, so we don't know whether we should use ref_addr or ref4. We create a worklist that will be processed during finalization to add attributes with the correct form (ref_addr or ref4). We add addDIEEntry to DwarfDebug to be a wrapper around DIE->addValue. It checks whether we know the correct form, if not, we update the worklist (DIEEntryWorklist). A testing case is added to show that we only create a single DIE for a type MDNode and we use ref_addr to refer to the type DIE. llvm-svn: 191792
* For COFF only: dwarf debug info output a label reference as a section ↵Carlo Kok2013-08-131-1/+3
| | | | | | relative item only when it's one of dw_from strp, sec_offset, ref_addr or op_call_ref instead of going by size. llvm-svn: 188296
* Be more rigorous about the sizes of forms and attributes.Eric Christopher2013-08-081-14/+14
| | | | llvm-svn: 187953
* Add a way to grab a particular attribute out of a DIE.Eric Christopher2013-08-071-0/+12
| | | | | | | Use it when we're looking for a string in particular. Update comments as well. llvm-svn: 187844
* Add preliminary support for hashing DIEs and breaking them intoEric Christopher2013-07-261-0/+24
| | | | | | | | | | | | | | | | type units. Initially this support is used in the computation of an ODR checker for C++. For now we're attaching it to the DIE, but in the future it will be attached to the type unit. This also starts breaking out types into the separation for type units, but without actually splitting the DIEs. In preparation for hashing the DIEs this adds a DIEString type that contains a StringRef with the string contained at the label. llvm-svn: 187213
* Debug Info: use module flag to set up Dwarf version.Manman Ren2013-07-021-0/+11
| | | | | | | | Correctly handles ref_addr depending on the Dwarf version. Emit Dwarf with version from module flag. TODO: turn on/off features depending on the Dwarf version. llvm-svn: 185484
* [DebugInfo] Introduce DIEExpr variant of DIEValue to hold MCExpr valuesUlrich Weigand2013-07-021-2/+28
| | | | | | | | | | | | This partially reverts r185202 and restores DIELabel to hold plain MCSymbol references. Instead, we add a new subclass DIEExpr of DIEValue that can hold generic MCExpr references. This is in preparation for supporting debug info for TLS variables on PowerPC, where we need to describe the variable location using a more complex expression than just MCSymbolRefExpr. llvm-svn: 185458
* DebugInfo: Pass MCSymbolRefExprs for labels instead of MCSymbolsDavid Blaikie2013-06-281-2/+2
| | | | | | | This is a precursor to adding debug info support for TLS which requires non-default relocations applied to TLS symbols. llvm-svn: 185202
* Remove a few fixmes, the only work we're doing is getting the stringEric Christopher2013-06-101-4/+0
| | | | | | to return and this is done all over. llvm-svn: 183704
OpenPOWER on IntegriCloud