================
@@ -2124,6 +2124,10 @@ class DICompileUnit : public DIScope {
   }
 
 public:
+  constexpr static unsigned GLOBALS_IDX = 6;
----------------
dzhidzhoev wrote:

> Given that operand numbers are still hardcoded explicitly in other places, 
> I'd prefer to leave these three as they were.

Hmm, I think it goes back to the time when there were no DINode (and children) 
classes, and all metadata were stored in plain MDNodes. Not sure if this 
convention should be followed by new code.

> I'd rather not do this, it looks misleading to me. It's not clear what the 
> purpose of these globals is or which metadata kind they belong to.

These constants are defined inside DICompileUnit class, and are used in getter 
and setters right there. For me it's rather clear, hm.
Anyway, I don't mind conventional approach.

https://github.com/llvm/llvm-project/pull/187927
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to