[llvm] [SystemZ][z/OS] Implement yaml2obj for GOFF Object File Format (PR #71445)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 8 01:37:06 PST 2023


================
@@ -0,0 +1,451 @@
+//===- yaml2goff - Convert YAML to a GOFF object file ---------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// The GOFF component of yaml2obj.
+///
+//===----------------------------------------------------------------------===//
+
+#include "llvm/ADT/IndexedMap.h"
+#include "llvm/ObjectYAML/ObjectYAML.h"
+#include "llvm/ObjectYAML/yaml2obj.h"
+#include "llvm/Support/ConvertEBCDIC.h"
+#include "llvm/Support/Endian.h"
+#include "llvm/Support/raw_ostream.h"
+
+using namespace llvm;
+
+namespace {
+
+static const uint8_t TXTMaxDataLength = 56;
+
+// Common flag values on records.
+enum {
+  // Flag: This record is continued.
+  Rec_Continued = 1 << (8 - 7 - 1),
----------------
jh7370 wrote:

I assume the `8 - 7 - 1` is something from the GOFF spec, because unless I'm being stupid, it would be simpler to write `0` (and possibly therefore to avoid the `<<` entirely)? 

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


More information about the llvm-commits mailing list