[Lldb-commits] [PATCH] D143061: [lldb][Language] Add more language types

Michael Buch via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 3 04:24:02 PDT 2023


Michael137 marked an inline comment as not done.
Michael137 added inline comments.


================
Comment at: lldb/include/lldb/lldb-enumerations.h:492
+  eLanguageTypeAda2005 = 0x002e,
+  eLanguageTypeAda2012 = 0x002f,
+
----------------
Michael137 wrote:
> aprantl wrote:
> > aprantl wrote:
> > > Michael137 wrote:
> > > > aprantl wrote:
> > > > > Would it make sense to generate this list from the macros in `llvm/include/llvm/BinaryFormat/Dwarf.def` with some clever application of the ## operator?
> > > > The only thing that's stopping us from doing this is that the constants for the vendor extensions are not consecutive with the rest of the constants. So if one ever does try to use that language constant we'd run into out-of-bounds accesses here and there
> > > Do have arrays that are indexed by language? Or what would be an example of that?
> > Also, we could still define eNumLanguagesTypes to be at the end of the official block?
> > Do have arrays that are indexed by language? Or what would be an example of that?
> 
> Yup, e.g., `Language::GetNameForLanguageType` and more crucially the `LanguageSet` type gets used by things like `GetAllTypeSystemSupportedLanguagesForExpressions`
> Also, we could still define eNumLanguagesTypes to be at the end of the official block?

That wouldn't quite work for the `LanguageSet` indexing because the vendor extension language codes are no consecutive to the other language codes. So the size of the `LanguageSet` would just balloon


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143061/new/

https://reviews.llvm.org/D143061



More information about the lldb-commits mailing list