[PATCH] D73263: [DWARF] Simplify DWARFExpression. NFC.
Igor Kudrin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 23 04:05:33 PST 2020
ikudrin created this revision.
ikudrin added reviewers: rnk, dblaikie, aprantl, probinson, friss.
ikudrin added projects: debug-info, LLVM.
Herald added a subscriber: hiraditya.
As `DataExtractor` already has a method to extract an unsigned value of a specified size, there is no need to duplicate that.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D73263
Files:
llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp
Index: llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp
===================================================================
--- llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp
+++ llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp
@@ -157,14 +157,7 @@
Operands[Operand] = Data.getU64(&Offset);
break;
case Operation::SizeAddr:
- if (AddressSize == 8) {
- Operands[Operand] = Data.getU64(&Offset);
- } else if (AddressSize == 4) {
- Operands[Operand] = Data.getU32(&Offset);
- } else {
- assert(AddressSize == 2);
- Operands[Operand] = Data.getU16(&Offset);
- }
+ Operands[Operand] = Data.getUnsigned(&Offset, AddressSize);
break;
case Operation::SizeRefAddr:
if (getRefAddrSize(AddressSize, Version) == 8) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73263.239846.patch
Type: text/x-patch
Size: 786 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200123/33da74c1/attachment.bin>
More information about the llvm-commits
mailing list