[llvm] [DebugInfo] Move `codeview::SourceLanguage` enumerators to CodeViewLanguages.def (NFC) (PR #141750)

Javier Lopez-Gomez via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 2 04:33:10 PDT 2025


jalopezg-git wrote:

> I don't know if the enum you're creating in #137223 is enough of a motivation. Does it really have much benefit over just storing the original enum values + tag in an unsigned? The new enum seems to be mostly used by looking at the tag and then casting to one of the original enums anyway.

Thanks for the review, @zmodem!  Partially agreed; actually, the previous incarnation of https://github.com/llvm/llvm-project/pull/137223 was using a `std::variant` of all possibly underlying `enum` types, but I tend to like the 'unified' enum a bit more.

Actually, given that DWARF header file `llvm/include/llvm/BinaryFormat/Dwarf.h` specifies SourceLanguages using a PP macro in a `.def` file, I believe this change adds a bit of 'symmetry' in that regard.

Also, this provides the additional benefit of making it possible to reuse these constants somewhere else in the future.  What do you think?

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


More information about the llvm-commits mailing list