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/Sema/SemaDecl.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/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 6e60ec7..8049ddf 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -2282,13 +2282,9 @@ void Sema::ActOnPopScope(SourceLocation Loc, Scope *S) { if (LabelDecl *LD = dyn_cast<LabelDecl>(D)) CheckPoppedLabel(LD, *this, addDiag); - // Partial translation units that are created in incremental processing must - // not clean up the IdResolver because PTUs should take into account the - // declarations that came from previous PTUs. - if (!PP.isIncrementalProcessingEnabled()) - IdResolver.RemoveDecl(D); - - // Warn on it if we are shadowing a declaration. + // Remove this name from our lexical scope, and warn on it if we haven't + // already. + IdResolver.RemoveDecl(D); auto ShadowI = ShadowingDecls.find(D); if (ShadowI != ShadowingDecls.end()) { if (const auto *FD = dyn_cast<FieldDecl>(ShadowI->second)) { |