Skip to content

Commit b2a82f9

Browse files
committed
[lldb][ASTUtils] Short-circuit multiplexed CompleteRedeclChain when we find definition
1 parent 5d0b831 commit b2a82f9

File tree

1 file changed

+8
-1
lines changed
  • lldb/source/Plugins/ExpressionParser/Clang

1 file changed

+8
-1
lines changed

lldb/source/Plugins/ExpressionParser/Clang/ASTUtils.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,16 @@ class SemaSourceWithPriorities : public ImporterBackedASTSource {
281281
return nullptr;
282282
}
283283

284+
/// Call ExternalASTSource::CompleteRedeclChain(D)
285+
/// on each AST source. Returns as soon as we got
286+
/// a definition for D.
284287
void CompleteRedeclChain(const clang::Decl *D) override {
285-
for (size_t i = 0; i < Sources.size(); ++i)
288+
for (size_t i = 0; i < Sources.size(); ++i) {
286289
Sources[i]->CompleteRedeclChain(D);
290+
if (auto *td = llvm::dyn_cast<clang::TagDecl>(D))
291+
if (td->getDefinition())
292+
return;
293+
}
287294
}
288295

289296
clang::Selector GetExternalSelector(uint32_t ID) override {

0 commit comments

Comments
 (0)