[Lldb-commits] [clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)
Ilia Kuklin via lldb-commits
lldb-commits at lists.llvm.org
Fri Jan 31 11:53:08 PST 2025
================
@@ -2367,11 +2369,36 @@ size_t DWARFASTParserClang::ParseChildEnumerators(
}
if (name && name[0] && got_value) {
- m_ast.AddEnumerationValueToEnumerationType(
+ auto ECD = m_ast.AddEnumerationValueToEnumerationType(
----------------
kuilpd wrote:
Well... I tried this, it works, but I encountered some problems:
1. `computeEnumBits` definition has to be in the header file, otherwise template instantiation doesn't work. I tried making the elements argument an `ArrayRef`, but it's also not working well with `enum_decl->enumerators()` returning `llvm::iterator_range<specific_decl_iterator<EnumConstantDecl>>`
2. Iteration over elements in `SemaDecl.cpp` checks for the element is a `EnumConstantDecl`, otherwise it's skipped, so I had to create a separate collection in case something is removed, and then pass that one to `computeEnumBits`
3. `isRepresentableIntegerValue` is a static function in `SemaDecl.cpp`, I'd rather not move somewhere else as well, since it's not needed on LLDB side anyway
Mostly I'm just not sure if it's a problem or not that `ASTContext.h` contains a definition of a function.
https://github.com/llvm/llvm-project/pull/115005
More information about the lldb-commits
mailing list