diff options
author | Jason Molenda <jmolenda@apple.com> | 2024-05-21 18:00:11 -0700 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2024-05-21 18:04:38 -0700 |
commit | dfdf1c5fe45a82b9c578306f3d7627fd251d63f8 (patch) | |
tree | cad49aba87a21874457b74236d7bbb4269b0b363 /clang/lib/Interpreter/IncrementalParser.cpp | |
parent | 203232ffbd80e9f4631213a3876f14dde155a92d (diff) | |
download | llvm-dfdf1c5fe45a82b9c578306f3d7627fd251d63f8.zip llvm-dfdf1c5fe45a82b9c578306f3d7627fd251d63f8.tar.gz llvm-dfdf1c5fe45a82b9c578306f3d7627fd251d63f8.tar.bz2 |
Revert "[clang-repl] Extend the C support. (#89804)"
This reverts commit 253c28fa829cee0104c2fc59ed1a958980b5138c.
This commit is causing failures on the lldb CI bots, e.g.
https://ci.swift.org/view/all/job/llvm.org/view/LLDB/job/as-lldb-cmake/4307/
On my local macOS desktop build,
```
bin/lldb-dotest -p TestImportBuiltinFileID.py
Assertion failed: (D->getLexicalDeclContext() == this && "Decl inserted into wrong lexical context"), function addHiddenDecl, file DeclBase.cpp, line 1692.
6 libsystem_c.dylib 0x0000000185f0b8d0 abort + 128
7 libsystem_c.dylib 0x0000000185f0abc8 err + 0
8 liblldb.19.0.0git.dylib 0x00000001311e5800 clang::DeclContext::addHiddenDecl(clang::Decl*) + 120
9 liblldb.19.0.0git.dylib 0x00000001311e5978 clang::DeclContext::addDecl(clang::Decl*) + 32
10 liblldb.19.0.0git.dylib 0x000000012f617b48 clang::Sema::ActOnStartTopLevelStmtDecl(clang::Scope*) + 64
11 liblldb.19.0.0git.dylib 0x000000012eaf76c8 clang::Parser::ParseTopLevelStmtDecl() + 208
12 liblldb.19.0.0git.dylib 0x000000012ec051fc clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) + 3412
13 liblldb.19.0.0git.dylib 0x000000012ec03274 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) + 2020
14 liblldb.19.0.0git.dylib 0x000000012eaca860 clang::ParseAST(clang::Sema&, bool, bool) + 604
15 liblldb.19.0.0git.dylib 0x000000012e8554c0 clang::ASTFrontendAction::ExecuteAction() + 308
16 liblldb.19.0.0git.dylib 0x000000012e854c78 clang::FrontendAction::Execute() + 124
17 liblldb.19.0.0git.dylib 0x000000012e76dcfc clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 984
18 liblldb.19.0.0git.dylib 0x000000012e784500 compileModuleImpl(clang::CompilerInstance&, clang::SourceLocation, llvm::StringRef, clang::FrontendInputFile, llvm::StringRef, llvm::StringRef, llvm::function_ref<void (clang::CompilerInstance&)>, llvm::function_ref<void (clang::CompilerInstance&)>)::$_1::operator()() const + 52
```
Reverting until Vassil has a chance to look int oit.
Diffstat (limited to 'clang/lib/Interpreter/IncrementalParser.cpp')
-rw-r--r-- | clang/lib/Interpreter/IncrementalParser.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/clang/lib/Interpreter/IncrementalParser.cpp b/clang/lib/Interpreter/IncrementalParser.cpp index 5bc8385..ef90fe9 100644 --- a/clang/lib/Interpreter/IncrementalParser.cpp +++ b/clang/lib/Interpreter/IncrementalParser.cpp @@ -387,7 +387,8 @@ std::unique_ptr<llvm::Module> IncrementalParser::GenModule() { void IncrementalParser::CleanUpPTU(PartialTranslationUnit &PTU) { TranslationUnitDecl *MostRecentTU = PTU.TUPart; - if (StoredDeclsMap *Map = MostRecentTU->getPrimaryContext()->getLookupPtr()) { + TranslationUnitDecl *FirstTU = MostRecentTU->getFirstDecl(); + if (StoredDeclsMap *Map = FirstTU->getPrimaryContext()->getLookupPtr()) { for (auto &&[Key, List] : *Map) { DeclContextLookupResult R = List.getLookupResult(); std::vector<NamedDecl *> NamedDeclsToRemove; @@ -406,16 +407,6 @@ void IncrementalParser::CleanUpPTU(PartialTranslationUnit &PTU) { } } } - - // FIXME: We should de-allocate MostRecentTU - for (Decl *D : MostRecentTU->decls()) { - auto *ND = dyn_cast<NamedDecl>(D); - if (!ND) - continue; - // Check if we need to clean up the IdResolver chain. - if (ND->getDeclName().getFETokenInfo()) - getCI()->getSema().IdResolver.RemoveDecl(ND); - } } llvm::StringRef IncrementalParser::GetMangledName(GlobalDecl GD) const { |