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

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 22 08:46:57 PDT 2024


================
@@ -37,9 +222,28 @@ void MappingTraits<GOFFYAML::FileHeader>::mapping(
                  FileHdr.TargetSoftwareEnvironment);
 }
 
+void CustomMappingTraits<GOFFYAML::RecordPtr>::inputOne(
+    IO &IO, StringRef Key, GOFFYAML::RecordPtr &Elem) {
+  if (Key == "Symbol") {
+    GOFFYAML::Symbol Sym;
+    IO.mapRequired("Symbol", Sym);
+    Elem = std::make_unique<GOFFYAML::Symbol>(std::move(Sym));
+  }
+}
+
+void CustomMappingTraits<GOFFYAML::RecordPtr>::output(
+    IO &IO, GOFFYAML::RecordPtr &Elem) {
+  if (auto *Sym = dyn_cast<GOFFYAML::Symbol>(Elem.get())) {
+    IO.mapRequired("Symbol", *Sym);
+  } else {
+    IO.setError("Unknown record type");
----------------
jh7370 wrote:

This error still doesn't conform to the coding standards. Please go and read and update accordingly.

Also, all error cases need tests.

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


More information about the llvm-commits mailing list