[clang] 34ccc3e - [hmaptool] Fix `NameError: global name 'num_buckets' is not defined` in `action_dump`.

Volodymyr Sapsai via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 19 16:27:22 PDT 2020


Author: Volodymyr Sapsai
Date: 2020-10-19T16:27:13-07:00
New Revision: 34ccc3e13bccde6f5cf993c744efe4bcb1fd439a

URL: https://github.com/llvm/llvm-project/commit/34ccc3e13bccde6f5cf993c744efe4bcb1fd439a
DIFF: https://github.com/llvm/llvm-project/commit/34ccc3e13bccde6f5cf993c744efe4bcb1fd439a.diff

LOG: [hmaptool] Fix `NameError: global name 'num_buckets' is not defined` in `action_dump`.

Added: 
    

Modified: 
    clang/utils/hmaptool/hmaptool

Removed: 
    


################################################################################
diff  --git a/clang/utils/hmaptool/hmaptool b/clang/utils/hmaptool/hmaptool
index 58baab2f7746..e647cde6bc46 100755
--- a/clang/utils/hmaptool/hmaptool
+++ b/clang/utils/hmaptool/hmaptool
@@ -147,7 +147,7 @@ def action_dump(name, args):
             suffix = hmap.get_string(suffix_idx)
 
             print ("  bucket[%d]: %r -> (%r, %r) -- %d" % (
-                i, key, prefix, suffix, (hmap_hash(key) & (num_buckets - 1))))
+                i, key, prefix, suffix, (hmap_hash(key) & (len(hmap.buckets) - 1))))
     else:
         mappings = sorted(hmap.mappings)
         for key,value in mappings:


        


More information about the cfe-commits mailing list