[PATCH] D110621: [llvm-locstats] Report a warnning if overflow was detected by llvm-dwarfdump
Djordje Todorovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 5 04:27:39 PDT 2021
djtodoro updated this revision to Diff 377151.
djtodoro added a comment.
- adding todo marker for handling other errs from llvm-dwarfdump
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110621/new/
https://reviews.llvm.org/D110621
Files:
llvm/test/tools/llvm-dwarfdump/X86/locstats-bytes-overflow.yaml
llvm/utils/llvm-locstats/llvm-locstats.py
Index: llvm/utils/llvm-locstats/llvm-locstats.py
===================================================================
--- llvm/utils/llvm-locstats/llvm-locstats.py
+++ llvm/utils/llvm-locstats/llvm-locstats.py
@@ -179,6 +179,11 @@
universal_newlines = True)
cmd_stdout, cmd_stderr = subproc.communicate()
+ # TODO: Handle other errors that are coming from llvm-dwarfdump.
+
+ if "field overflows" in cmd_stderr:
+ print('warning: There is an overflow detected by llvm-dwarfdump backend.')
+
# Get the JSON and parse it.
json_parsed = None
Index: llvm/test/tools/llvm-dwarfdump/X86/locstats-bytes-overflow.yaml
===================================================================
--- llvm/test/tools/llvm-dwarfdump/X86/locstats-bytes-overflow.yaml
+++ llvm/test/tools/llvm-dwarfdump/X86/locstats-bytes-overflow.yaml
@@ -1,4 +1,7 @@
-# RUN: yaml2obj %s | llvm-dwarfdump --statistics - 2>&1 | FileCheck %s
+# RUN: yaml2obj %s -o %t.o
+# RUN: llvm-dwarfdump --statistics %t.o 2>&1 | FileCheck %s
+# RUN: %llvm-locstats %t.o 2>&1 | FileCheck %s --check-prefix=LOCSTATS
+# RUN: rm %t.o
## Check that we are covering the situation when a stat field overflows.
##
@@ -22,6 +25,7 @@
## [0x0000000000000003, 0x0000000000000005): DW_OP_reg2 RCX)
# CHECK: warning: this field overflows
+# LOCSTATS: warning: There is an overflow detected by llvm-dwarfdump backend.
--- !ELF
FileHeader:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110621.377151.patch
Type: text/x-patch
Size: 1434 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211005/e9f26a57/attachment.bin>
More information about the llvm-commits
mailing list