[PATCH] D27772: Add the ability to get attribute values as Optional<T>

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 14 14:20:54 PST 2016


aprantl accepted this revision.
aprantl added a comment.
This revision is now accepted and ready to land.

Thanks, this is much cleaner than using special ~1ULL return values!
LGTM, and if we can get the Optional-default-value patch in later, this will be even better.



================
Comment at: lib/DebugInfo/DWARF/DWARFDie.cpp:255
+  if (auto HighPCVal = getAttributeValueAsAddress(DW_AT_high_pc))
+    HighPC = *HighPCVal; // High PC is an address.
+  else if (auto Offset = getAttributeValueAsUnsignedConstant(DW_AT_high_pc))
----------------
formatting nit: Comment should go above the statement.


https://reviews.llvm.org/D27772





More information about the llvm-commits mailing list