[PATCH] D76067: [llvm-dwp] Refactor handling of section identifiers. NFCI.

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 12 08:08:42 PDT 2020


ikudrin created this revision.
ikudrin added reviewers: dblaikie, probinson, labath, jhenderson.
ikudrin added projects: LLVM, debug-info.

There is a number of places in `llvm-dwp.cpp` where a section identifier is translated into an index of an internal array of section contributions, and another place where the index is converted to an on-disk value. All these places use direct expressions like `<id> - DW_SECT_INFO` or `<index> + DW_SECT_INFO`, exploiting the fact that `DW_SECT_INFO` is the minimum valid value of that kind.

The patch adds distinct functions for that translation. The goal is to make the code more readable and to prepare it to support index sections of new versions, where the numeric scheme of section indexes is changed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76067

Files:
  llvm/tools/llvm-dwp/llvm-dwp.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76067.249928.patch
Type: text/x-patch
Size: 4429 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200312/bcfdbc4d/attachment-0001.bin>


More information about the llvm-commits mailing list