Skip to content

Commit 2eb70c1

Browse files
committed
[lldb] Avoid enum as unordered_map key in TypeSystemClang
This apparently doesn't work with the GCC used on Swift CI's Linux bots.
1 parent 4903d45 commit 2eb70c1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9695,14 +9695,15 @@ GetSpecializedASTName(ScratchTypeSystemClang::IsolatedASTKind feature) {
96959695
}
96969696

96979697
TypeSystemClang &ScratchTypeSystemClang::GetIsolatedAST(
9698-
ScratchTypeSystemClang::IsolatedASTKind feature) {
9698+
ScratchTypeSystemClang::IsolatedASTKind feature_enum) {
9699+
int feature = static_cast<int>(feature_enum);
96999700
auto found_ast = m_isolated_asts.find(feature);
97009701
if (found_ast != m_isolated_asts.end())
97019702
return *found_ast->second;
97029703

97039704
// Couldn't find the requested sub-AST, so create it now.
97049705
std::unique_ptr<TypeSystemClang> new_ast;
9705-
new_ast.reset(new SpecializedScratchAST(GetSpecializedASTName(feature),
9706+
new_ast.reset(new SpecializedScratchAST(GetSpecializedASTName(feature_enum),
97069707
m_triple, CreateASTSource()));
97079708
m_isolated_asts[feature] = std::move(new_ast);
97089709
return *m_isolated_asts[feature];

lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ class ScratchTypeSystemClang : public TypeSystemClang {
12281228
/// Map from IsolatedASTKind to their actual TypeSystemClang instance.
12291229
/// This map is lazily filled with sub-ASTs and should be accessed via
12301230
/// `GetSubAST` (which lazily fills this map).
1231-
std::unordered_map<IsolatedASTKind, std::unique_ptr<TypeSystemClang>>
1231+
std::unordered_map<int, std::unique_ptr<TypeSystemClang>>
12321232
m_isolated_asts;
12331233
};
12341234

0 commit comments

Comments
 (0)