[PATCH] D46485: Add python tool to dump and construct header maps

Bruno Cardoso Lopes via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 15 21:48:10 PDT 2018


bruno marked an inline comment as done.
bruno added inline comments.


================
Comment at: utils/hmaptool/hmaptool:55
+            # The number of buckets must be a power of two.
+            if num_buckets == 0 or (num_buckets & num_buckets - 1) != 0:
+                raise SystemExit("error: %s: invalid number of buckets" % (
----------------
jkorous wrote:
> Wouldn't it be simpler to use modulo 2?
> 
> ```
> if num_buckets % 2 == 0
> ```
We want it to be a power of two, not just a multiple.


================
Comment at: utils/hmaptool/hmaptool:234
+
+    if len(args) != 2:
+        parser.error("invalid number of arguments")
----------------
jkorous wrote:
> Aren't we expecting just single argument (<headermap path>) here?
We also need the <dir> from --build-path <dir>


Repository:
  rC Clang

https://reviews.llvm.org/D46485





More information about the cfe-commits mailing list