1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
llvm-mirror/tools/dsymutil
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
..
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
DwarfLinker.cpp Add the ability to get attribute values as Optional<T> 2016-12-14 22:38:08 +00:00
LLVMBuild.txt
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
NonRelocatableStringpool.h One more batch of self-containing headers. 2016-01-27 19:29:56 +00:00