summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
Commit message (Collapse)AuthorAgeFilesLines
...
* DwarfDebug: Change Abbreviations member from pointer to referenceDavid Blaikie2013-10-301-3/+3
| | | | llvm-svn: 193699
* Debug Info: support for DW_FORM_ref_addr.Manman Ren2013-10-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Grammar.Eric Christopher2013-10-241-1/+1
| | | | llvm-svn: 193372
* Remove some dead code. (DarwinGDBCompat was retired in r189903).Adrian Prantl2013-10-151-8/+0
| | | | llvm-svn: 192731
* Add DbgVariable::resolve per Eric's suggestion.Manman Ren2013-10-081-0/+5
| | | | llvm-svn: 192218
* Debug Info: In DIBuilder, the derived-from field of a DW_TAG_pointer_typeManman Ren2013-10-051-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | is updated to use DITypeRef. Move isUnsignedDIType and getOriginalTypeSize from DebugInfo.h to be static helper functions in DwarfCompileUnit. We already have a static helper function "isTypeSigned" in DwarfCompileUnit, and a pointer to DwarfDebug is added to resolve the derived-from field. All three functions need to go across link for derived-from fields, so we need to get hold of a type identifier map. A pointer to DwarfDebug is also added to DbgVariable in order to resolve the derived-from field. Debug info verifier is updated to check a derived-from field is a TypeRef. Verifier will not go across link for derived-from fields, in debug info finder, we go across the link to add derived-from fields to types. Function getDICompositeType is only used by dragonegg and since dragonegg does not generate identifier for types, we use an empty map to resolve the derived-from field. When printing a derived-from field, we use DITypeRef::getName to either return the type identifier or getName of the DIType. A paired commit at clang is required due to changes to DIBuilder. llvm-svn: 192018
* Fix one comment and update another. Slightly reformat.Eric Christopher2013-10-051-3/+2
| | | | llvm-svn: 192016
* Temporarily revert r176882 as it needs to be implemented in a differentEric Christopher2013-10-041-4/+0
| | | | | | way for all platforms. llvm-svn: 191975
* Temporarily revert r191792 as it is causing some LTO debug failuresEric Christopher2013-10-041-54/+2
| | | | | | | on platforms with relocations in debug info and also temporarily revert r191800 due to conflicts with the revert of r191792. llvm-svn: 191967
* Remove wild .debug_aranges entries generated from unimportant labelsAlexey Samsonov2013-10-031-3/+4
| | | | | | | | | | | | | | | | r191052 added emitting .debug_aranges to Clang, but this functionality is broken: it uses all MC labels added in DWARF Asm printer, including the labels for build relocations between different DWARF sections, like .Lsection_line or .Ldebug_loc0. As a result, if any DIE .debug_info would contain "DW_AT_location=0x123" attribute, .debug_aranges would also contain a range starting from 0x123, breaking tools that rely on this section. This patch fixes this by using only MC labels that corresponds to the addresses in the user program. llvm-svn: 191884
* Debug Info: In DIBuilder, the derived-from field of a DW_TAG_pointer_typeManman Ren2013-10-011-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | is updated to use DITypeRef. Move isUnsignedDIType and getOriginalTypeSize from DebugInfo.h to be static helper functions in DwarfCompileUnit. We already have a static helper function "isTypeSigned" in DwarfCompileUnit, and a pointer to DwarfDebug is added to resolve the derived-from field. All three functions need to go across link for derived-from fields, so we need to get hold of a type identifier map. A pointer to DwarfDebug is also added to DbgVariable in order to resolve the derived-from field. Debug info verifier is updated to check a derived-from field is a TypeRef. Verifier will not go across link for derived-from fields, in debug info finder, we go across the link to add derived-from fields to types. Function getDICompositeType is only used by dragonegg and since dragonegg does not generate identifier for types, we use an empty map to resolve the derived-from field. When printing a derived-from field, we use DITypeRef::getName to either return the type identifier or getName of the DIType. A paired commit at clang is required due to changes to DIBuilder. llvm-svn: 191800
* Debug Info: remove duplication of DIEs when a DIE is part of the type systemManman Ren2013-10-011-0/+51
| | | | | | | | | | | | | | | | | | | | | | | 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
* The DW_AT_GNU_pubnames/pubtypes attributes are actually formEric Christopher2013-09-301-0/+1
| | | | | | | SEC_OFFSET from the beginning of the section so go ahead and emit a label at the beginning of each one. llvm-svn: 191710
* Fixed debug_aranges handling for common symbols.Richard Mitton2013-09-231-0/+7
| | | | | | | | | | The size of common symbols is now tracked correctly, so they can be listed in the arange section without needing knowledge of other following symbols. .comm (and .lcomm) do not indicate to the system assembler any particular section to use, so we have to treat them as having no section. Test case update to account for this. llvm-svn: 191210
* Added support for generate DWARF .debug_aranges sections automatically.Richard Mitton2013-09-191-1/+14
| | | | llvm-svn: 191052
* Add initial support for handling gnu style pubnames accepted by someEric Christopher2013-09-131-2/+8
| | | | | | | | versions of gold. This support is designed to allow gold to produce gdb_index sections similar to the accelerator tables and consumable by gdb. llvm-svn: 190649
* Revert "Give internal classes hidden visibility."Benjamin Kramer2013-09-111-5/+5
| | | | | | | It works with clang, but GCC has different rules so we can't make all of those hidden. This reverts commit r190534. llvm-svn: 190536
* Give internal classes hidden visibility.Benjamin Kramer2013-09-111-5/+5
| | | | | | Worth 100k on a linux/x86_64 Release+Asserts clang. llvm-svn: 190534
* Debug Info: create scope children DIEs when the scope DIE is not null.Manman Ren2013-09-101-0/+6
| | | | | | | | | | | | | | | | We try to create the scope children DIEs after we create the scope DIE. But to avoid emitting empty lexical block DIE, we first check whether a scope DIE is going to be null, then create the scope children if it is not null. From the number of children, we decide whether to actually create the scope DIE. This patch also removes an early exit which checks for a special condition. It also removes deletion of un-used children DIEs that are generated because we used to generate children DIEs before the scope DIE. Deletion of un-used children DIEs may cause problem because we sometimes keep created DIEs in a member variable of a CU. llvm-svn: 190421
* Debug Info: define a DIRef template.Manman Ren2013-09-101-1/+4
| | | | | | | | | | | | | Specialize the constructors for DIRef<DIScope> and DIRef<DIType> to make sure the Value is indeed a scope ref and a type ref. Use DIScopeRef for DIScope::getContext and DIType::getContext and use DITypeRef for getContainingType and getClassType. DIScope::generateRef now returns a DIScopeRef instead of a "Value *" for readability and type safety. llvm-svn: 190418
* Debug Info: move DIScope::getContext back from DwarfDebug.Manman Ren2013-09-091-3/+0
| | | | | | | | This partially reverts r190330. DIScope::getContext now returns DIScopeRef instead of DIScope. We construct a DIScopeRef from DIScope when we are dealing with subprogram, lexical block or name space. llvm-svn: 190362
* Rename for consistency.Eric Christopher2013-09-091-1/+1
| | | | llvm-svn: 190345
* Debug Info: move DIScope::getContext to DwarfDebug.Manman Ren2013-09-091-0/+3
| | | | | | | | | | | | DIScope::getContext is a wrapper function that calls the specific getContext method on each subclass. When we switch DIType::getContext to return DIScopeRef instead of DIScope, DIScope::getContext can no longer return a DIScope without a type identifier map. DIScope::getContext is only used by DwarfDebug, so we move it to DwarfDebug to have easy access to the type identifier map. llvm-svn: 190330
* Debug Info: Move isSubprogramContext from DebugInfo to DwarfDebug.Manman Ren2013-09-091-0/+4
| | | | | | | | | | This helper function needs the type identifier map when we switch DIType::getContext to return DIScopeRef instead of DIScope. Since isSubprogramContext is used by DwarfDebug only, We move it to DwarfDebug to have easy access to the map. llvm-svn: 190325
* Debug Info: Rename DITypeRef to DIScopeRef.Manman Ren2013-09-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | A reference to a scope is more general than a reference to a type since DIType is a subclass of DIScope. A reference to a type can be either an identifier for the type or the DIType itself, while a reference to a scope can be either an identifier for the type (when the scope is indeed a type) or the DIScope itself. A reference to a type and a reference to a scope will be resolved in the same way. The only difference is in the verifier when a field is a reference to a type (i.e. the containing type field of a DICompositeType) or a field is a reference to a scope (i.e. the context field of a DIType). This is to get ready for switching DIType::getContext to return DIScopeRef instead of DIScope. Tighten up isTypeRef and isScopeRef to make sure the identifier is not empty and the MDNode is DIType for TypeRef and DIScope for ScopeRef. llvm-svn: 190322
* Debug Info: Use identifier to reference DIType in base type field ofManman Ren2013-09-051-0/+7
| | | | | | | | | | | | | | | | | | | | | | ptr_to_member. We introduce a new class DITypeRef that represents a reference to a DIType. It wraps around a Value*, which can be either an identifier in MDString or an actual MDNode. The class has a helper function "resolve" that finds the actual MDNode for a given DITypeRef. We specialize getFieldAs to return a field that is a reference to a DIType. To correctly access the base type field of ptr_to_member, getClassType now calls getFieldAs<DITypeRef> to return a DITypeRef. Also add a typedef for DITypeIdentifierMap and a helper generateDITypeIdentifierMap in DebugInfo.h. In DwarfDebug.cpp, we keep a DITypeIdentifierMap and call generateDITypeIdentifierMap to actually populate the map. Verifier is updated accordingly. llvm-svn: 190081
* Remove support for the .debug_inlined section. No known softwareEric Christopher2013-08-281-8/+0
| | | | | | in use supports it. llvm-svn: 189439
* Have the skeleton compile unit construction method take the CU itEric Christopher2013-08-261-1/+1
| | | | | | | | | | is constructing from as an input and keep the same unique identifier. We can use this to connect items which must stay in the .o file (e.g. pubnames and pubtypes) to the skeleton cu rather than having duplicate unique numbers for the sections and needing to do lookups based on MDNode. llvm-svn: 189293
* Treat the pubtypes section similarly to the pubnames section and emitEric Christopher2013-08-261-3/+6
| | | | | | | | | it by default under linux or when we're trying to keep compatibility with old gdb versions. Fix testcase for option name change. llvm-svn: 189289
* Turn on pubnames by default on linux.Eric Christopher2013-08-191-0/+1
| | | | | | | | | Until gdb supports the new accelerator tables we should add the pubnames section so that gdb_index can be generated from gold at link time. On darwin we already emit the accelerator tables and so don't need to worry about pubnames. llvm-svn: 188708
* Be more rigorous about the sizes of forms and attributes.Eric Christopher2013-08-081-1/+1
| | | | llvm-svn: 187953
* Add preliminary support for hashing DIEs and breaking them intoEric Christopher2013-07-261-0/+7
| | | | | | | | | | | | | | | | 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
* Clarify comments.Eric Christopher2013-07-141-4/+1
| | | | llvm-svn: 186297
* Update comment to avoid mentioning DbgValues which is an instanceEric Christopher2013-07-081-1/+1
| | | | | | variable later in the class. llvm-svn: 185866
* Debug Info: clean up usage of Verify.Manman Ren2013-07-081-3/+3
| | | | | | | No functionality change. It should suffice to check the type of a debug info metadata, instead of calling Verify. llvm-svn: 185847
* Make DotDebugLocEntry a class, reorder the members along with commentsEric Christopher2013-07-031-5/+20
| | | | | | for them and update all uses. llvm-svn: 185588
* Add names to the header file since they help in documenting the APIEric Christopher2013-07-031-10/+11
| | | | | | (and for consistency). llvm-svn: 185585
* Move typedefs inside the class that they belong to.Eric Christopher2013-07-031-10/+7
| | | | llvm-svn: 185573
* Remove unused field.Eric Christopher2013-07-031-12/+19
| | | | llvm-svn: 185523
* Constify a few functions.Eric Christopher2013-07-031-3/+3
| | | | llvm-svn: 185520
* Introduce some typedefs for DenseMaps containing SmallVectors so the vector ↵Craig Topper2013-07-031-2/+6
| | | | | | size doesn't have to repeated when creating iterators for the DenseMap. llvm-svn: 185508
* Move instance variable before experimental section.Eric Christopher2013-07-031-4/+5
| | | | llvm-svn: 185497
* Fix typo to make grep for DW_AT_comp_dir work without case-insensitiveEric Christopher2013-07-031-1/+1
| | | | | | grep. llvm-svn: 185496
* Remove unnecessary forward declare.Eric Christopher2013-07-031-1/+0
| | | | llvm-svn: 185495
* Debug Info: use module flag to set up Dwarf version.Manman Ren2013-07-021-0/+5
| | | | | | | | 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] Hold generic MCExpr in AddrPoolUlrich Weigand2013-07-021-2/+2
| | | | | | | | | | | This changes the AddrPool infrastructure to enable it to hold generic MCExpr expressions, not just MCSymbolRefExpr. 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: 185459
* PR14728: DebugInfo: TLS variables with -gsplit-dwarfDavid Blaikie2013-07-011-1/+2
| | | | llvm-svn: 185398
* DebugInfo: Simplify the AddressPool representationDavid Blaikie2013-06-281-3/+2
| | | | llvm-svn: 185189
* DebugInfo: constify the AddressPool MCSymbol pointersDavid Blaikie2013-06-281-2/+3
| | | | llvm-svn: 185188
* LTO+Debug Info: revert r182791.Manman Ren2013-05-291-9/+0
| | | | | | | | | | | | Since the testing case uses ref_addr, which requires version 3+ to work, we will solve the dwarf version issue first. This patch also causes failures in one of the bots. I will update the patch accordingly in my next attempt. rdar://13926659 llvm-svn: 182867
OpenPOWER on IntegriCloud