[PATCH] D32609: Update llvm-readobj -coff-resources to display tree structure.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 4 14:23:40 PDT 2017


ruiu added inline comments.


================
Comment at: llvm/tools/llvm-readobj/COFFDumper.cpp:1628-1631
+  if (Index >= (Table.NumberOfNameEntries + Table.NumberOfIDEntries))
+    return object_error::parse_failed;
+  return *(reinterpret_cast<const coff_resource_dir_entry *>(&Table + 1) +
+           Index);
----------------
This is a comment about the style, but for operators who's precedences are "obvious", we don't use that many parentheses.

Everyone knows that + has lower precedence than >=.

*(reinterpret_cast<foo>(bar)) is the same as *reinterpret_cast<foo>(bar).

`(&Table + 1) + Index` is the same as &Table + 1 + Index.


https://reviews.llvm.org/D32609





More information about the llvm-commits mailing list