[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:24 PST 2024
================
@@ -21,10 +21,102 @@
namespace llvm {
+namespace GOFF {
+
+enum ESDFlags {
+ ESD_FillByteValuePresent = 1 << 7,
+ ESD_SymbolDisplayFlag = 1 << 6,
+ ESD_SymbolRenamingFlag = 1 << 5,
+ ESD_RemovableClass = 1 << 4
+};
+
+enum {
+ ESD_Mask_ERST = 0x07,
+ ESD_Mask_RQW = 0x07,
+ ESD_Mask_TextStyle = 0xf0,
+ ESD_Mask_BindingAlgorithm = 0x0f,
+};
+
+enum ESDBAFlags {
+ ESD_BA_Movable = 0x01,
+ ESD_BA_ReadOnly = 0x2,
+ ESD_BA_NoPrime = 0x4,
+ ESD_BA_COMMON = 0x8,
+ ESD_BA_Indirect = 0x10,
+};
+} // end namespace GOFF
+
// The structure of the yaml files is not an exact 1:1 match to GOFF. In order
// to use yaml::IO, we use these structures which are closer to the source.
namespace GOFFYAML {
+LLVM_YAML_STRONG_TYPEDEF(uint8_t, GOFF_ESDSYMBOLTYPE)
+LLVM_YAML_STRONG_TYPEDEF(uint8_t, GOFF_ESDNAMESPACEID)
+LLVM_YAML_STRONG_TYPEDEF(uint8_t, GOFF_ESDFlags)
+LLVM_YAML_STRONG_TYPEDEF(uint8_t, GOFF_ESDAMODE)
+LLVM_YAML_STRONG_TYPEDEF(uint8_t, GOFF_ESDRMODE)
+LLVM_YAML_STRONG_TYPEDEF(uint8_t, GOFF_ESDTEXTSTYLE)
+LLVM_YAML_STRONG_TYPEDEF(uint8_t, GOFF_ESDBINDINGALGORITHM)
+LLVM_YAML_STRONG_TYPEDEF(uint8_t, GOFF_ESDTASKINGBEHAVIOR)
+LLVM_YAML_STRONG_TYPEDEF(uint8_t, GOFF_ESDEXECUTABLE)
+LLVM_YAML_STRONG_TYPEDEF(uint8_t, GOFF_ESDLINKAGETYPE)
+LLVM_YAML_STRONG_TYPEDEF(uint8_t, GOFF_ESDBINDINGSTRENGTH)
+LLVM_YAML_STRONG_TYPEDEF(uint8_t, GOFF_ESDLOADINGBEHAVIOR)
+LLVM_YAML_STRONG_TYPEDEF(uint8_t, GOFF_ESDBINDINGSCOPE)
+LLVM_YAML_STRONG_TYPEDEF(uint8_t, GOFF_ESDALIGNMENT)
+LLVM_YAML_STRONG_TYPEDEF(uint64_t, GOFF_BAFLAGS)
+
+LLVM_YAML_STRONG_TYPEDEF(uint8_t, GOFF_TEXTRECORDSTYLE)
+
+struct RecordBase {
+ enum RecordBaseKind { RBK_Symbol};
+
+private:
+ const RecordBaseKind Kind;
+
+protected:
+ RecordBase(RecordBaseKind Kind) : Kind(Kind) {}
+
+public:
+ RecordBaseKind getKind() const { return Kind; }
+};
+typedef std::unique_ptr<RecordBase> RecordPtr;
----------------
jh7370 wrote:
Two nits:
a) I think `using RecordPtr = std::unique_ptr<RecordBase>` is generally preferred in newer code.
b) I'd leave a blank line between the class and alias.
https://github.com/llvm/llvm-project/pull/75971
More information about the llvm-commits
mailing list