summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add initial support for handling gnu style pubnames accepted by someEric Christopher2013-09-131-6/+109
| | | | | | | | 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
* Reformat and hoist section grabbing to top level.Eric Christopher2013-09-131-25/+30
| | | | llvm-svn: 190648
* Debug info: add more comments.Manman Ren2013-09-111-2/+14
| | | | llvm-svn: 190544
* Hoist section call out of loop.Eric Christopher2013-09-101-2/+2
| | | | llvm-svn: 190440
* Debug Info: create scope children DIEs when the scope DIE is not null.Manman Ren2013-09-101-19/+48
| | | | | | | | | | | | | | | | 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-5/+0
| | | | | | | | | | | | | 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-23/+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
* Always add global names. We're adding them in the rest of the codeEric Christopher2013-09-091-3/+2
| | | | | | | | | as well as types. No functional change as they're not emitted unless the option is true anyhow. llvm-svn: 190346
* Rename for consistency.Eric Christopher2013-09-091-3/+3
| | | | llvm-svn: 190345
* Debug Info: Use DIScopeRef for DIType::getContext.Manman Ren2013-09-091-2/+2
| | | | | | | | | | | | | | | | | In DIBuilder, the context field of a TAG_member is updated to use the scope reference. Verifier is updated accordingly. DebugInfoFinder now needs to generate a type identifier map to have access to the actual scope. Same applies for BreakpointPrinter. processModule of DebugInfoFinder is called during initialization phase of the verifier to make sure the type identifier map is constructed early enough. We are now able to unique a simple class as demonstrated by the added testing case. llvm-svn: 190334
* Debug Info: move DIScope::getContext to DwarfDebug.Manman Ren2013-09-091-0/+23
| | | | | | | | | | | | 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/+13
| | | | | | | | | | 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-3/+3
| | | | | | | | | | | | | | | | | | | | | | 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/+6
| | | | | | | | | | | | | | | | | | | | | | 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
* Move accelerator table defines and constants to Dwarf.h sinceEric Christopher2013-09-051-6/+6
| | | | | | | | we're proposing it for DWARF5. No functional change intended. llvm-svn: 190074
* Remove hack ensuring that darwin didn't produce dwarf > 3 for modulesEric Christopher2013-09-041-5/+1
| | | | | | | | without a limiting factor. Update all testcases accordingly. llvm-svn: 190002
* Revert "Revert r189902 as the workaround shouldn't be necessary anymore."Eric Christopher2013-09-041-1/+5
| | | | | | Needs testcase updates. llvm-svn: 190000
* Revert r189902 as the workaround shouldn't be necessary anymore.Eric Christopher2013-09-041-5/+1
| | | | llvm-svn: 189999
* Unify and clean up.Eric Christopher2013-09-041-9/+4
| | | | llvm-svn: 189977
* Revert "Revert "Remove the darwin gdb option, that version of gdb is now ↵Michael Gottesman2013-09-041-15/+2
| | | | | | | | | | | | | | dead and the rest of the compatibility should be done on a dwarf-N level."" This reverts commit r189913. Talked with Eric on IRC. I am going to XFAIL the failing test since it is using what Eric described as "the member hack" which was needed on that old GDB. Sorry for the noise! llvm-svn: 189914
* Revert "Remove the darwin gdb option, that version of gdb is now dead and ↵Michael Gottesman2013-09-041-2/+15
| | | | | | | | | | | | the rest of the compatibility should be done on a dwarf-N level." This reverts commit r189903. This commit broke the phase 1 buildbot for a while. http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-nobootstrap-RAincremental/builds/6684 llvm-svn: 189913
* Remove the darwin gdb option, that version of gdb is now dead andEric Christopher2013-09-041-15/+2
| | | | | | the rest of the compatibility should be done on a dwarf-N level. llvm-svn: 189903
* Make the default dwarf version 3 for darwin when we can't find oneEric Christopher2013-09-041-1/+5
| | | | | | in the module. Add a FIXME with a comment about darwin's ld. llvm-svn: 189902
* Don't bother emitting the pubtypes section on darwin since there aren'tEric Christopher2013-08-301-7/+3
| | | | | | any maintained consumers of it on that platform. llvm-svn: 189631
* Reformat slightly.Eric Christopher2013-08-301-4/+4
| | | | llvm-svn: 189630
* Remove support for the .debug_inlined section. No known softwareEric Christopher2013-08-281-105/+0
| | | | | | in use supports it. llvm-svn: 189439
* Make the lifetime of the DICompileUnit we're constructing from theEric Christopher2013-08-261-2/+1
| | | | | | MDNode more clear as just for a single argument. llvm-svn: 189294
* Have the skeleton compile unit construction method take the CU itEric Christopher2013-08-261-5/+5
| | | | | | | | | | 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
* Remove duplicate set of CompilationDir.Eric Christopher2013-08-261-1/+0
| | | | llvm-svn: 189292
* Remove the language parameter and variable from the compile unit. WeEric Christopher2013-08-261-6/+4
| | | | | | can get it via the MDNode that's passed in. Save that instead. llvm-svn: 189291
* Treat the pubtypes section similarly to the pubnames section and emitEric Christopher2013-08-261-14/+14
| | | | | | | | | 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
* Only emit the section sym if we're emitting the section.Eric Christopher2013-08-261-1/+2
| | | | llvm-svn: 189288
* Fix thinko.Eric Christopher2013-08-261-1/+1
| | | | llvm-svn: 189279
* Add a function object to compare the first or second component of a std::pair.Benjamin Kramer2013-08-241-12/+4
| | | | | | Replace instances of this scattered around the code base. llvm-svn: 189169
* Simplify code. No functionality change.Benjamin Kramer2013-08-241-6/+1
| | | | llvm-svn: 189168
* DwarfDebug: Delete orphaned children.Benjamin Kramer2013-08-241-1/+4
| | | | | | Leak found by valgrind. llvm-svn: 189167
* DebugInfo: Do not use the DWARF Version for the .debug_pubnames or ↵David Majnemer2013-08-211-2/+3
| | | | | | | | | | | | | | | | | | | | | | | .debug_pubtypes version field Summary: LLVM would generate DWARF with version 3 in the .debug_pubname and .debug_pubtypes version fields. This would lead SGI dwarfdump to fail parsing the DWARF with (in the instance of .debug_pubnames) would exit with: dwarfdump ERROR: dwarf_get_globals: DW_DLE_PUBNAMES_VERSION_ERROR (123) This fixes PR16950. Reviewers: echristo, dblaikie Reviewed By: echristo CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1454 llvm-svn: 188869
* Use less verbose code and update comments.Eric Christopher2013-08-191-23/+16
| | | | llvm-svn: 188711
* Turn on pubnames by default on linux.Eric Christopher2013-08-191-10/+21
| | | | | | | | | 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
* Output DW_AT_stmt_list dwarf debug info as DW_FORM_sec_offset instead of ↵Carlo Kok2013-08-131-1/+1
| | | | | | DW_FORM_data4 as it is a section offset (fixes the coff/dwarf debug info statement locations) llvm-svn: 188297
* Add the start of DIE hashing for DWARF4 type units and split dwarfEric Christopher2013-08-131-2/+12
| | | | | | | | | | CUs. Currently only hashes the name of CUs and the names of any children, but it's an obvious first step to show the framework. The testcase should continue to be correct, however, as it's an empty TU. llvm-svn: 188243
* Move the addition of the dwo_id as late as possible after everythingEric Christopher2013-08-121-21/+24
| | | | | | has been finalized except for sizes and offsets. Update test accordingly. llvm-svn: 188199
* Move hash computation code into a separate class and file.Eric Christopher2013-08-081-99/+9
| | | | | | No functional change intended. llvm-svn: 188028
* Reflow for loop.Eric Christopher2013-08-081-2/+2
| | | | llvm-svn: 187954
* Be more rigorous about the sizes of forms and attributes.Eric Christopher2013-08-081-2/+2
| | | | llvm-svn: 187953
* Remove some parens. No functional change.Eric Christopher2013-08-071-4/+4
| | | | llvm-svn: 187872
* Add a way to grab a particular attribute out of a DIE.Eric Christopher2013-08-071-14/+6
| | | | | | | Use it when we're looking for a string in particular. Update comments as well. llvm-svn: 187844
* Move somewhat messy conditional out of line.Eric Christopher2013-08-071-7/+11
| | | | | | No functional change. llvm-svn: 187843
* Recommit previous cleanup with a fix for c++98 ambiguity.Eric Christopher2013-08-051-5/+2
| | | | llvm-svn: 187752
* Revert "Use existing builtin hashing functions to make this routine more"Eric Christopher2013-08-051-2/+5
| | | | | | This reverts commit r187745. llvm-svn: 187747
OpenPOWER on IntegriCloud