[llvm] [SystemZ][z/OS] yaml2obj GOFF symbols (PR #75971)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 00:59:26 PST 2024


================
@@ -245,6 +248,57 @@ void GOFFState::writeHeader(GOFFYAML::FileHeader &FileHdr) {
   }
 }
 
+void GOFFState::writeSymbol(GOFFYAML::Symbol Sym) {
+  if (Sym.ID != SymbolID + 1)
+    reportError("symbol IDs not monotonic " + Sym.Name);
----------------
jh7370 wrote:

I thought I raised this point before: in general, yaml2obj should be permissive in what it accepts as input, as one of the main purposes of yaml2obj is to craft inputs for tests. To test edge cases in file format handling, you need to be able to craft inputs that don't follow the rules of the file format. In other words, if you don't need symbol IDs (in this case) to be monotonic to be able to physically write things, don't enforce it.

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


More information about the llvm-commits mailing list