summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Sink DwarfDebug::attachLowHighPC into DwarfCompileUnitDavid Blaikie2014-10-041-0/+14
| | | | | | | One of many things to sink down into DwarfCompileUnit to allow handling of subprograms in both the skeleton and dwo CU under Fission. llvm-svn: 219058
* Move DwarfCompileUnit from DwarfUnit.h to its own header (DwarfCompileUnit.h)David Blaikie2014-10-041-0/+277
| | | | | | | | | | | | 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
* DebugInfo: Rename DwarfCompileUnit.* to DwarfUnit.* to match their contents.David Blaikie2013-12-021-1983/+0
| | | | llvm-svn: 196140
* DebugInfo: Refactor CompileUnit into a Unit baseclass and ↵David Blaikie2013-12-021-109/+97
| | | | | | | | | | CompileUnit/TypeUnit derived classes. Header/cpp file rename to follow immediately - just splitting out the commits for ease of review/reading to demonstrate that the renaming changes are entirely mechanical. llvm-svn: 196139
* DebugInfo: Type Units: Propagate the correct DW_AT_language into type units.David Blaikie2013-12-021-1/+1
| | | | llvm-svn: 196130
* DebugInfo: Do not include variables only referenced by templates in aranges.David Blaikie2013-11-271-3/+6
| | | | | | | | ARanges included even extern variables referenced by pointer non-type template parameters even though that variable isn't part of this compilation unit. llvm-svn: 195895
* DebugInfo: Remove CompileUnit::constructTypeDIEImpl now that it's just a ↵David Blaikie2013-11-261-11/+2
| | | | | | | | | simple wrapper again. r195698 moved the type unit checking up into getOrCreateTypeDIE so remove the redundant check and fold the functions back together again. llvm-svn: 195700
* DebugInfo: Avoid emitting pubtype entries for type DIEs that just indirect ↵David Blaikie2013-11-261-37/+43
| | | | | | to a type unit. llvm-svn: 195698
* DebugInfo: Pubtypes: Coelesce pubtype registration with accelerator type ↵David Blaikie2013-11-261-39/+12
| | | | | | | | | | registration. It might be possible to eventually use one data structure, but I haven't looked at the exact criteria used for accelerator tables and pubtypes to see if there's good reason for the differences between the two or not. llvm-svn: 195696
* In Dwarf 3 (and Dwarf 2) attributes whose value are offsets into aEric Christopher2013-11-211-9/+29
| | | | | | | | | | | | | | | | | | | | | 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
* Move DebugInfoOffset member near the other data member it helps describe.Eric Christopher2013-11-211-4/+4
| | | | llvm-svn: 195299
* Reorder language in the CompileUnit description and add a comment.Eric Christopher2013-11-211-4/+4
| | | | | | Language may only be a temporary addition. llvm-svn: 195296
* DwarfCompileUnit: Initialize DebugInfoOffset.David Blaikie2013-11-201-2/+2
| | | | | | | | | | | | While not strictly necessary (the class has an invariant that "setDebugInfoOffset" is called before "getDebugInfoOffset" - anyone client that actually gets the default zero offset is buggy/broken) this is consistent with the code as originally written and the removal of the initialization was an accident in r195166. Suggested by Manman Ren. llvm-svn: 195263
* CR feedback for r195166: Add comments regarding type unit mapping and type ↵David Blaikie2013-11-201-2/+7
| | | | | | | | units disabling cross-CU sharing. Changes suggested by Manman Ren. llvm-svn: 195262
* DebugInfo: Partial implementation of DWARF type units.David Blaikie2013-11-191-10/+47
| | | | | | | | | | | | | | 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
* DebugInfo: Constify accelerator table handling, and separate type ↵David Blaikie2013-11-191-12/+16
| | | | | | accelarator insertion in preparation for a second use of this code from type units. llvm-svn: 195164
* Formatting and 80-col.Eric Christopher2013-11-191-3/+3
| | | | llvm-svn: 195122
* DebugInfo: Simplify a few more explicit constructions, underconstrained ↵David Blaikie2013-11-181-21/+18
| | | | | | types, and make DIType(MDNode*) explicit like all the other DI* node ctors. llvm-svn: 195055
* Remove unnecessary temporary construction.David Blaikie2013-11-171-1/+1
| | | | llvm-svn: 194981
* Remove redundant explicit default initialization.David Blaikie2013-11-171-2/+2
| | | | llvm-svn: 194980
* DwarfCompileUnit: Add type safety to createGlobalVariableDIEDavid Blaikie2013-11-171-3/+2
| | | | llvm-svn: 194979
* DwarfCompileUnit: Push type safety of DIDescriptor through ↵David Blaikie2013-11-161-4/+4
| | | | | | CompileUnit::createAndAddDIE. llvm-svn: 194902
* DwarfCompileUnit: Remove unnecessary OwningPtr<T>::get() callDavid Blaikie2013-11-161-1/+1
| | | | llvm-svn: 194901
* For dwarf4 use the correct form for referencing debug_loc locations,Eric Christopher2013-11-161-1/+3
| | | | | | | | | and update test cases accordingly. This doesn't affect the output dumped using llvm-dwarfdump, but readelf does now dump the debug_loc section. llvm-svn: 194898
* DwarfCompileUnit: Add type safety by using DICompileUnit rather than raw ↵David Blaikie2013-11-151-5/+5
| | | | | | MDNode* for the CU metadata node llvm-svn: 194893
* DwarfCompileUnit: Simplify getLanguage() calls to use existing member functionDavid Blaikie2013-11-151-3/+3
| | | | llvm-svn: 194892
* Replace the dangling context hotfix with an assertion.Adrian Prantl2013-11-151-4/+1
| | | | llvm-svn: 194883
* DwarfCompileUnit: Push DIDescriptors through a getDIE/insertDIEDavid Blaikie2013-11-151-16/+17
| | | | llvm-svn: 194875
* DwarfCompileUnit: Push DIDescriptor usage out from isShareableAcrossCUsDavid Blaikie2013-11-151-5/+5
| | | | | | | This is the first of a few similar patches. We'll see how far it goes/makes sense. llvm-svn: 194871
* Reimplement r194843 in a slightly less broken way.Adrian Prantl2013-11-151-3/+5
| | | | llvm-svn: 194848
* Restore the behaviour from before r194728.Adrian Prantl2013-11-151-1/+3
| | | | | | If getDIE() fails, getOrCreateContextDIE() should also return the CUDie. llvm-svn: 194843
* Use a reference rather than a pointer as we don't expect a NULLEric Christopher2013-11-151-19/+19
| | | | | | | | DbgVariable. No functional change. llvm-svn: 194761
* DebugInfo: Simplify/narrow null-check for getOrCreateTypeDavid Blaikie2013-11-141-2/+4
| | | | llvm-svn: 194737
* DwarfCompileUnit::getOrCreateContext: Return the compile unit DIE rather ↵David Blaikie2013-11-141-11/+4
| | | | | | than null. llvm-svn: 194728
* Remove unnecessary 'else' after return.David Blaikie2013-11-141-4/+3
| | | | llvm-svn: 194724
* Unify the adding of enumerators with the construction of the enumeration.Eric Christopher2013-11-111-22/+24
| | | | llvm-svn: 194401
* Formatting.Eric Christopher2013-11-111-9/+8
| | | | llvm-svn: 194400
* 80-col.Eric Christopher2013-11-111-5/+7
| | | | llvm-svn: 194399
* Just pass the DIComposite type by value instead of by pointer.Eric Christopher2013-11-111-5/+5
| | | | llvm-svn: 194398
* DebugInfo: Emit member variable locations as data instead of expressions in ↵David Blaikie2013-11-011-29/+31
| | | | | | | | | blocks Drive by space optimization. Also makes the DIEs more regular which might speed up DWARF parsing. llvm-svn: 193835
* Debug Info: remove duplication of DIEs when a DIE can be shared across CUs.Manman Ren2013-10-311-4/+46
| | | | | | | | | | | | | | | | | | | 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
* DebugInfo: Push header handling down into CompileUnitDavid Blaikie2013-10-301-0/+13
| | | | | | | This is a preliminary step to handling type units by abstracting over all (type or compile) units. llvm-svn: 193714
* Debug Info: support for DW_FORM_ref_addr.Manman Ren2013-10-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Debug Info: instead of calling addToContextOwner which constructs the contextManman Ren2013-10-291-18/+9
| | | | | | | | | | | | | | | after the DIE creation, we construct the context first. Ensure that we create the context before we create a type so that we can add the newly created type to the parent. Remove last use of addToContextOwner now that it's not needed. We use createAndAddDIE to wrap around "new DIE(". Now all shareable DIEs should be added to their parents right after the creation. Reviewed off-list by Eric, Thanks. llvm-svn: 193657
* Add a helper getSymbol to AsmPrinter.Rafael Espindola2013-10-291-3/+3
| | | | llvm-svn: 193627
* Debug Info: instead of calling addToContextOwner which constructs the contextManman Ren2013-10-291-7/+17
| | | | | | | | | | | | after the DIE creation, we construct the context first. This touches creation of namespaces and global variables. The purpose is to handle all DIE creations similarly: constructs the context first, then creates the DIE and immediately adds the DIE to its parent. We use createAndAddDIE to wrap around "new DIE(". llvm-svn: 193589
* Debug Info: use createAndAddDIE for newly-created Subprogram DIEs.Manman Ren2013-10-291-9/+5
| | | | | | | | | | | More patches will be submitted to convert "new DIE(" to use createAddAndDIE in DwarfCompileUnit.cpp. This will simplify implementation of addDIEEntry where we have to decide between ref4 and ref_addr, because DIEs that can be shared across CU will be added to a CU already. Reviewed off-list by Eric. llvm-svn: 193567
* Debug Info: add a helper function createAndAddDIE.Manman Ren2013-10-291-29/+24
| | | | | | | | | | | | | | It wraps around "new DIE(" and handles the bookkeeping part of the newly-created DIE. It adds the DIE to its parent, and calls insertDIE if necessary. It makes sure that bookkeeping is done at the earliest time and we should not see parentless DIEs if all constructions of DIEs go through this helper function. Later on, we can use an allocator for DIE allocation, and will only need to change createAndAddDIE instead of modifying all the "new DIE(". Reviewed off-list by Eric. llvm-svn: 193566
* Debug Info: code clean up.Manman Ren2013-10-231-22/+14
| | | | | | | | | | | Since we never insert DIE for DITemplateTypeParameter to a map, there is no need to call getDIE in getOrCreateTemplateTypeParameterDIE. It is also renamed to constructTemplateTypeParameterDIE to match with other construct functions in CompileUnit. Same applies to getOrCreateTemplateValueParameterDIE. llvm-svn: 193287
* Debug Info: code clean up.Manman Ren2013-10-231-3/+3
| | | | | | | Rename createMemberDIE to constructMemberDIE to match other construct functions in CompileUnit. llvm-svn: 193286
OpenPOWER on IntegriCloud