summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DIE.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Const-ify some printing and dumping code for DIEValues.Eric Christopher2013-05-311-6/+6
| | | | llvm-svn: 183057
* Make getCompileUnit non-const and return the current DIE if itEric Christopher2013-05-141-2/+2
| | | | | | | happens to be a compile unit. Noticed on inspection and tested via calling on a newly created compile unit. No functional change. llvm-svn: 181835
* Remove unnecessary instance variable and rework logic accordingly.Eric Christopher2013-05-061-5/+3
| | | | llvm-svn: 181227
* Grammar.Eric Christopher2013-05-061-1/+2
| | | | llvm-svn: 181226
* Debug Info: revert 178722 for now.Manman Ren2013-04-041-6/+0
| | | | | | | | | | | | | There is a difference for FORM_ref_addr between DWARF 2 and DWARF 3+. Since Eric is against guarding DWARF 2 ref_addr with DarwinGDBCompat, we are still in discussion on how to handle this. The correct solution is to update our header to say version 4 instead of version 2 and update tool chains as well. rdar://problem/13559431 llvm-svn: 178806
* Debug Info: according to DWARF 2, FORM_ref_addr the same size as an address onManman Ren2013-04-041-0/+6
| | | | | | | | | | | the target system. It was hard-coded to 4 bytes before. I can't get llvm to generate a ref_addr on a reasonably sized testing case. rdar://problem/13559431 llvm-svn: 178722
* Use SmallVectorImpl instead of SmallVector at the uses.Eric Christopher2013-03-291-3/+3
| | | | llvm-svn: 178386
* Use 12 as the magic number for our abbreviation data and ourEric Christopher2013-03-291-3/+3
| | | | | | | die values. A lot of DIEs have 10 attributes in C++ code (example clang), none had more than 12. Seems like a good default. llvm-svn: 178366
* No functionality change. Use unreachable in getCompileUnit.Manman Ren2013-03-131-1/+1
| | | | llvm-svn: 176962
* Debug Info: use DW_FORM_ref_addr instead of DW_FORM_ref4 if the referenced DIEManman Ren2013-03-121-0/+11
| | | | | | | | | | | | | | | | belongs to a different compile unit. DW_FORM_ref_addr should be used for cross compile-unit reference. When compiling a large application, we got a dwarfdump verification error where abstract_origin points to nowhere. This error can't be reproduced on any testing case in MultiSource. We may have other cases where we use DW_FORM_ref4 unconditionally. rdar://problem/13370501 llvm-svn: 176882
* Fix the assembly and dissassembly of DW_FORM_sec_offset. Found this byEric Christopher2013-01-171-0/+1
| | | | | | | | | changing both the string of the dwo_name to be correct and the type of the statement list. Testcases all around. llvm-svn: 172699
* Add the DW_AT_GNU_addr_base for the skeleton cu. Add support forEric Christopher2013-01-171-0/+2
| | | | | | | emitting the dwarf32 version of DW_FORM_sec_offset and correct disassembler support. llvm-svn: 172698
* Split address information for DWARF5 split dwarf proposal. This involvesEric Christopher2013-01-151-0/+2
| | | | | | | | | | | | | | | using the DW_FORM_GNU_addr_index and a separate .debug_addr section which stays in the executable and is fully linked. Sneak in two other small changes: a) Print out the debug_str_offsets.dwo section. b) Change form we're expecting the entries in the debug_str_offsets.dwo section to take from ULEB128 to U32. Add tests for all of this in the fission-cu.ll test. llvm-svn: 172578
* These functions have default arguments of 0 for the last arg. UseEric Christopher2013-01-091-2/+2
| | | | | | them and add one where it seemed obvious that we wanted one. llvm-svn: 171932
* Whitespace and 80-col.Eric Christopher2013-01-071-1/+1
| | | | llvm-svn: 171803
* Add support for separating strings for the split debug info DWARF5Eric Christopher2013-01-071-0/+2
| | | | | | | | | | | | | proposal. This leaves the strings in the skeleton die as strp, but in all dwo files they're accessed now via DW_FORM_GNU_str_index. Add support for dumping these sections and modify the fission-cu.ll testcase to have the correct strings and form. Fix a small bug in the fixed form sizes routine that involved out of array accesses for the table and add a FIXME in the extractFast routine to fix this up. llvm-svn: 171779
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-1/+1
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Revert the majority of the next patch in the address space series:Chandler Carruth2012-11-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r165941: Resubmit the changes to llvm core to update the functions to support different pointer sizes on a per address space basis. Despite this commit log, this change primarily changed stuff outside of VMCore, and those changes do not carry any tests for correctness (or even plausibility), and we have consistently found questionable or flat out incorrect cases in these changes. Most of them are probably correct, but we need to devise a system that makes it more clear when we have handled the address space concerns correctly, and ideally each pass that gets updated would receive an accompanying test case that exercises that pass specificaly w.r.t. alternate address spaces. However, from this commit, I have retained the new C API entry points. Those were an orthogonal change that probably should have been split apart, but they seem entirely good. In several places the changes were very obvious cleanups with no actual multiple address space code added; these I have not reverted when I spotted them. In a few other places there were merge conflicts due to a cleaner solution being implemented later, often not using address spaces at all. In those cases, I've preserved the new code which isn't address space dependent. This is part of my ongoing effort to clean out the partial address space code which carries high risk and low test coverage, and not likely to be finished before the 3.2 release looms closer. Duncan and I would both like to see the above issues addressed before we return to these changes. llvm-svn: 167222
* Resubmit the changes to llvm core to update the functions to support ↵Micah Villmow2012-10-151-4/+4
| | | | | | different pointer sizes on a per address space basis. llvm-svn: 165941
* Revert 165732 for further review.Micah Villmow2012-10-111-4/+4
| | | | llvm-svn: 165747
* Add in the first iteration of support for llvm/clang/lldb to allow variable ↵Micah Villmow2012-10-111-4/+4
| | | | | | per address space pointer sizes to be optimized correctly. llvm-svn: 165726
* Move TargetData to DataLayout.Micah Villmow2012-10-081-5/+5
| | | | llvm-svn: 165402
* 80-col fixup.Eric Christopher2012-09-101-1/+2
| | | | llvm-svn: 163569
* Clean this up slightly, doesn't really fall through.Eric Christopher2012-08-291-2/+1
| | | | llvm-svn: 162848
* Use DW_FORM_flag_present to save space in debug information if we'reEric Christopher2012-08-241-0/+8
| | | | | | | | not in darwin gdb compat mode. Fixes rdar://10975088 llvm-svn: 162526
OpenPOWER on IntegriCloud