1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/tools/dsymutil
Greg Clayton 41824e5554 Cleanup how DWARFDie attributes are accessed and decoded.
Removed all DWARFDie::getAttributeValueAs*() calls.
Renamed:
  Optional<DWARFFormValue> DWARFDie::getAttributeValue(dwarf::Attribute);
To:
  Optional<DWARFFormValue> DWARFDie::find(dwarf::Attribute);
Added:
  Optional<DWARFFormValue> DWARFDie::findRecursively(dwarf::Attribute);
  
All decoding of Optional<DWARFFormValue> values are now done using the dwarf::to*() functions from DWARFFormValue.h:

Old code:
  
  auto DeclLine = DWARFDie.getAttributeValueAsSignedConstant(DW_AT_decl_line).getValueOr(0);
  
New code:

  auto DeclLine = toUnsigned(DWARFDie.find(DW_AT_decl_line), 0);
  
This composition helps us since we can now easily do:

  auto DeclLine = toUnsigned(DWARFDie.findRecursively(DW_AT_decl_line), 0);
  
This allows us to easily find attribute values in the current DIE only (the first new code above) or in any DW_AT_abstract_origin or DW_AT_specification Dies using the line above. Note that the code line length is shorter and more concise.

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

llvm-svn: 291959
2017-01-13 21:08:18 +00:00
..
BinaryHolder.cpp Make the Error class constructor protected 2016-11-11 04:28:40 +00:00
BinaryHolder.h [dsymutil] Replace TimeValue with TimePoint 2016-11-09 11:43:52 +00:00
CMakeLists.txt [CMake] llvm-dsymutil depends on intrinsics_gen 2016-11-19 02:02:46 +00:00
DebugMap.cpp [dsymutil] Replace TimeValue with TimePoint 2016-11-09 11:43:52 +00:00
DebugMap.h [dsymutil] Replace TimeValue with TimePoint 2016-11-09 11:43:52 +00:00
dsymutil.cpp Search for llvm-symbolizer binary in the same directory as argv[0], before 2016-06-09 00:53:21 +00:00
dsymutil.h dsymutil: Fix a comment. [-Wdocumentation] 2015-09-23 00:19:20 +00:00
DwarfLinker.cpp Cleanup how DWARFDie attributes are accessed and decoded. 2017-01-13 21:08:18 +00:00
LLVMBuild.txt [dsymutil] Add the DwarfStreamer class. 2015-02-28 00:29:11 +00:00
MachODebugMapParser.cpp [dsymutil] Replace TimeValue with TimePoint 2016-11-09 11:43:52 +00:00
MachOUtils.cpp Change that to include MCMachObjectWriter.h 2016-06-22 23:30:43 +00:00
MachOUtils.h [dsymutil] Try to find lipo first besides dsymutil before looking up the PATH. 2015-10-08 22:35:53 +00:00
NonRelocatableStringpool.h One more batch of self-containing headers. 2016-01-27 19:29:56 +00:00