[llvm] [Object] Beginnings of SFrame parser and dumper (PR #147294)

Pavel Labath via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 15 03:23:07 PDT 2025


================
@@ -15,31 +15,35 @@
 #ifndef LLVM_BINARYFORMAT_SFRAME_H
 #define LLVM_BINARYFORMAT_SFRAME_H
 
+#include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/BitmaskEnum.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/Endian.h"
 
-namespace llvm::sframe {
+namespace llvm {
+
+template <typename T> struct EnumEntry;
+
+namespace sframe {
 
 LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();
 
 constexpr uint16_t Magic = 0xdee2;
 
 enum class Version : uint8_t {
-  V1 = 1,
-  V2 = 2,
+#define HANDLE_SFRAME_VERSION(CODE, NAME) NAME = CODE,
----------------
labath wrote:

The last part is the tricky one. I don't see a way to ensure a new enumerator isn't  added without the corresponding stringifier without introducing more boilerplate. I guess I'm going to stick with the .def file.

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


More information about the llvm-commits mailing list