[PATCH] D146567: Assert in codesize.py that we have exactly one of size..text and size.__text

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 22 11:54:26 PDT 2023


paquette updated this revision to Diff 507459.
paquette added a comment.

Addressing review feedback before pushing


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146567/new/

https://reviews.llvm.org/D146567

Files:
  litsupport/modules/codesize.py


Index: litsupport/modules/codesize.py
===================================================================
--- litsupport/modules/codesize.py
+++ litsupport/modules/codesize.py
@@ -37,6 +37,13 @@
                     name = values[0]
                     val = int(values[1])
                     metrics['size.%s' % name] = val
+                    # The text size output here comes from llvm-size.
+                    # Darwin and GNU produce differently-formatted output.
+                    # Check that we have exactly one of the valid outputs.
+                    assert not ('size.__text' in metrics and
+                                'size..text' in metrics), """Both 'size.__text'
+                                and 'size..text' present in metrics.
+                                Only one of them should exist."""
                 except ValueError:
                     logging.info("Ignoring malformed output line: %s", line)
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146567.507459.patch
Type: text/x-patch
Size: 947 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230322/b747c7e6/attachment.bin>


More information about the llvm-commits mailing list