[llvm] [llvm-exegesis] Skip benchmark entries with unknown opcodes in analysis mode (PR #201162)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 03:37:12 PDT 2026


================
@@ -63,8 +64,22 @@ struct YamlContext {
 
   std::string &getLastError() { return ErrorStream.str(); }
 
+  // Returns the recorded error to report to the YAML parser from a
+  // ScalarTraits::input. When ContinueOnError is set, recoverable per-entry
+  // errors (e.g. an unknown opcode in a bitrotted sample) are left recorded for
+  // the caller to inspect but are not reported to the parser, which would
+  // otherwise abort parsing of every remaining document.
+  StringRef getInputError() {
+    return ContinueOnError ? StringRef() : StringRef(getLastError());
+  }
+
   raw_string_ostream &getErrorStream() { return ErrorStream; }
 
+  // When set, ScalarTraits::input swallows recoverable deserialization errors
+  // (see getInputError) so that readYamls can skip the offending entry instead
+  // of aborting the whole file.
+  bool ContinueOnError = false;
----------------
RKSimon wrote:

Do we ever use this with a false value? It looks to be always set to true below.

https://github.com/llvm/llvm-project/pull/201162


More information about the llvm-commits mailing list