[Lldb-commits] [PATCH] D82160: [lldb][PDB] Constexpr static member values as AST literals
Aleksandr Urakov via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Jun 22 03:43:11 PDT 2020
aleksandr.urakov added a comment.
Hello! Thanks for the patch, generally it looks good to me, the only thing I worry about is scoped enums (please, see the comment below).
================
Comment at: lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:7324-7331
+ // If the variable is an enum type, take the underlying integer type as
+ // the type of the integer literal.
+ if (const EnumType *enum_type = llvm::dyn_cast<EnumType>(qt.getTypePtr())) {
+ const EnumDecl *enum_decl = enum_type->getDecl();
+ qt = enum_decl->getIntegerType();
+ }
+ var->setInit(IntegerLiteral::Create(ast, init_value, qt.getUnqualifiedType(),
----------------
I'm not sure, can we initialize a member this way if it has a scoped enum type?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82160/new/
https://reviews.llvm.org/D82160
More information about the lldb-commits
mailing list