[llvm] [GOFF] Refactor writing GOFF records (PR #93855)

Kevin P. Neal via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 26 06:24:25 PDT 2024


================
@@ -12,34 +12,92 @@
 
 #include "llvm/ObjectYAML/GOFFYAML.h"
 #include "llvm/BinaryFormat/GOFF.h"
-#include <string.h>
 
 namespace llvm {
-namespace GOFFYAML {
 
-Object::Object() {}
+namespace yaml {
 
-} // namespace GOFFYAML
+void ScalarEnumerationTraits<GOFFYAML::GOFF_AMODE>::enumeration(
+    IO &IO, GOFFYAML::GOFF_AMODE &Value) {
+#define ECase(X) IO.enumCase(Value, #X, GOFF::ESD_##X)
+  ECase(AMODE_None);
+  ECase(AMODE_24);
+  ECase(AMODE_31);
+  ECase(AMODE_ANY);
----------------
kpneal wrote:

No. AMODE_None means unspecified, and that means it defaults to AMODE 24. AMODE_ANY means either AMODE 24 or AMODE 31. These are different bit patterns in the object and thus cannot be collapsed without throwing away data from the object.

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


More information about the llvm-commits mailing list