1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 05:23:45 +02:00
llvm-mirror/include/llvm/DebugInfo/DWARF
Greg Clayton 9a690524e7 Add the ability to get attribute values as Optional<T>
When getting attributes it is sometimes nicer to use Optional<T> some of the time instead of magic values. I tried to cut over to only using the Optional values but it made many of the call sites very messy, so it makes sense the leave in the calls that can return a default value. Otherwise code that looks like this:

uint64_t CallColumn = Die.getAttributeValueAsAddress(DW_AT_call_line, 0);

Has to be turned into:

uint64_t CallColumn = 0;
if (auto CallColumnValue = Die.getAttributeValueAsAddress(DW_AT_call_line))
    CallColumn = *CallColumnValue;

The first snippet of code looks much better. But in cases where you want an offset that may or may not be there, the following code looks better:

if (auto StmtOffset = Die.getAttributeValueAsSectionOffset(DW_AT_stmt_list)) {
  // Use StmtOffset
}

Differential Revision: https://reviews.llvm.org/D27772

llvm-svn: 289731
2016-12-14 22:38:08 +00:00
..
DWARFAbbreviationDeclaration.h Wdocumentation fix 2016-12-14 15:14:44 +00:00
DWARFAcceleratorTable.h Switch all DWARF variables for tags, attributes and forms over to use the llvm::dwarf enumerations instead of using raw uint16_t values. This allows easier debugging as users can see the values of the enumerations in the variables view that will show the enumeration string instead of just a number. 2016-10-27 16:32:04 +00:00
DWARFCompileUnit.h llvm-symbolizer: Avoid infinite recursion walking dwos where the dwo contains a dwo_name attribute 2016-04-22 22:50:56 +00:00
DWARFContext.h [DebugInfo] Fix some Clang-tidy modernize-use-default, modernize-use-equal-delete and Include What You Use warnings; other minor fixes (NFC). 2016-11-18 18:00:19 +00:00
DWARFDebugAbbrev.h [ObjectYAML] Support for DWARF __debug_abbrev section 2016-12-07 18:52:59 +00:00
DWARFDebugAranges.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
DWARFDebugArangeSet.h [ObjectYAML] Support for DWARF debug_aranges 2016-12-09 00:26:44 +00:00
DWARFDebugFrame.h Re-submit r256008 "Improve DWARFDebugFrame::parse to also handle __eh_frame." 2016-01-26 15:09:42 +00:00
DWARFDebugInfoEntry.h Make a DWARFDIE class that can help avoid using the wrong DWARFUnit when extracting attributes 2016-12-13 18:25:19 +00:00
DWARFDebugLine.h Avoid dsymutil calls to getFileNameByIndex. 2016-07-22 01:41:32 +00:00
DWARFDebugLoc.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
DWARFDebugMacro.h [DebugInfo] Fix some Clang-tidy modernize-use-default, modernize-use-equal-delete and Include What You Use warnings; other minor fixes (NFC). 2016-11-18 18:00:19 +00:00
DWARFDebugRangeList.h DWARFDebugRangeList: make the list of entries available to clients. 2015-03-13 23:30:07 +00:00
DWARFDie.h Add the ability to get attribute values as Optional<T> 2016-12-14 22:38:08 +00:00
DWARFFormValue.h Improve DWARF parsing speed by improving DWARFAbbreviationDeclaration 2016-11-15 01:23:06 +00:00
DWARFGdbIndex.h Revert r282238 "Revert r282235 "[llvm-dwarfdump] - Teach dwarfdump to dump gdb-index section."" 2016-09-23 11:01:53 +00:00
DWARFRelocMap.h
DWARFSection.h Add more missing #includes, found by modules build. 2015-05-11 22:41:07 +00:00
DWARFTypeUnit.h dwarfdump: -summarize-types: print a short summary (unqualified type name, hash, length) of type units rather than dumping contents 2016-10-18 21:09:48 +00:00
DWARFUnit.h Add the ability to get attribute values as Optional<T> 2016-12-14 22:38:08 +00:00
DWARFUnitIndex.h [llvm-dwp] Merge cu_index from DWPs 2016-02-06 01:15:26 +00:00