[flang-commits] [flang] [flang] Add ability to have special allocator for descriptor data (PR #100690)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Mon Jul 29 09:26:15 PDT 2024


================
@@ -160,8 +164,15 @@ typedef struct CFI_cdesc_t {
 #endif
 
 #ifdef __cplusplus
-  RT_API_ATTRS inline bool HasAddendum() const { return extra & 1; }
-  RT_API_ATTRS inline int GetAllocIdx() const { return ((int)extra >> 1); }
+  RT_API_ATTRS inline bool HasAddendum() const {
+    return extra & _CFI_ADDENDUM_FLAG;
+  }
+  RT_API_ATTRS inline void SetHasAddendum() {
+    extra = extra | _CFI_ADDENDUM_FLAG;
+  }
+  RT_API_ATTRS inline int GetAllocIdx() const {
+    return ((int)extra >> _CFI_ADDENDUM_BITS);
----------------
klausler wrote:

This will have to change later if another field is added.  Might also want to have a member function that sets the field.

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


More information about the flang-commits mailing list