Skip to content

Commit 181d6e2

Browse files
committed
Revert "[lldb][DWARFASTParserClang] Correctly resolve imported namespaces during expression evaluation"
This reverts commit 1ba6ec0. Fails on linux buildbots. Differential Revision: https://reviews.llvm.org/D143398
1 parent 8570bee commit 181d6e2

File tree

5 files changed

+0
-105
lines changed

5 files changed

+0
-105
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3304,11 +3304,6 @@ DWARFASTParserClang::GetClangDeclContextForDIE(const DWARFDIE &die) {
33043304
try_parsing_type = false;
33053305
break;
33063306

3307-
case DW_TAG_imported_declaration:
3308-
decl_ctx = ResolveImportedDeclarationDIE(die);
3309-
try_parsing_type = false;
3310-
break;
3311-
33123307
case DW_TAG_lexical_block:
33133308
decl_ctx = GetDeclContextForBlock(die);
33143309
try_parsing_type = false;
@@ -3470,42 +3465,6 @@ DWARFASTParserClang::ResolveNamespaceDIE(const DWARFDIE &die) {
34703465
return nullptr;
34713466
}
34723467

3473-
clang::NamespaceDecl *
3474-
DWARFASTParserClang::ResolveImportedDeclarationDIE(const DWARFDIE &die) {
3475-
assert(die && die.Tag() == DW_TAG_imported_declaration);
3476-
3477-
// See if we cached a NamespaceDecl for this imported declaration
3478-
// already
3479-
auto it = m_die_to_decl_ctx.find(die.GetDIE());
3480-
if (it != m_die_to_decl_ctx.end())
3481-
return static_cast<clang::NamespaceDecl *>(it->getSecond());
3482-
3483-
clang::NamespaceDecl *namespace_decl = nullptr;
3484-
3485-
const DWARFDIE imported_uid =
3486-
die.GetAttributeValueAsReferenceDIE(DW_AT_import);
3487-
if (!imported_uid)
3488-
return nullptr;
3489-
3490-
switch (imported_uid.Tag()) {
3491-
case DW_TAG_imported_declaration:
3492-
namespace_decl = ResolveImportedDeclarationDIE(imported_uid);
3493-
break;
3494-
case DW_TAG_namespace:
3495-
namespace_decl = ResolveNamespaceDIE(imported_uid);
3496-
break;
3497-
default:
3498-
return nullptr;
3499-
}
3500-
3501-
if (!namespace_decl)
3502-
return nullptr;
3503-
3504-
LinkDeclContextToDIE(namespace_decl, die);
3505-
3506-
return namespace_decl;
3507-
}
3508-
35093468
clang::DeclContext *DWARFASTParserClang::GetClangDeclContextContainingDIE(
35103469
const DWARFDIE &die, DWARFDIE *decl_ctx_die_copy) {
35113470
SymbolFileDWARF *dwarf = die.GetDWARF();

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -132,17 +132,6 @@ class DWARFASTParserClang : public DWARFASTParser {
132132

133133
clang::NamespaceDecl *ResolveNamespaceDIE(const DWARFDIE &die);
134134

135-
/// Returns the namespace decl that a DW_TAG_imported_declaration imports.
136-
///
137-
/// \param[in] die The import declaration to resolve. If the DIE is not a
138-
/// DW_TAG_imported_declaration the behaviour is undefined.
139-
///
140-
/// \returns The decl corresponding to the namespace that the specified
141-
/// 'die' imports. If the imported entity is not a namespace
142-
/// or another import declaration, returns nullptr. If an error
143-
/// occurs, returns nullptr.
144-
clang::NamespaceDecl *ResolveImportedDeclarationDIE(const DWARFDIE &die);
145-
146135
bool ParseTemplateDIE(const DWARFDIE &die,
147136
lldb_private::TypeSystemClang::TemplateParameterInfos
148137
&template_param_infos);

lldb/test/API/commands/expression/namespace-alias/Makefile

Lines changed: 0 additions & 3 deletions
This file was deleted.

lldb/test/API/commands/expression/namespace-alias/TestInlineNamespaceAlias.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

lldb/test/API/commands/expression/namespace-alias/main.cpp

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)