Skip to content

Commit c79eace

Browse files
zoecarverhyp
authored andcommitted
no merge: add some debugging for linux.
1 parent 70a353b commit c79eace

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3923,6 +3923,17 @@ namespace {
39233923
auto dc = Impl.importDeclContextOf(
39243924
decl, importedName.getEffectiveContext());
39253925

3926+
#ifndef NDEBUG
3927+
if (dc == nullptr) {
3928+
llvm::dbgs() << "No decl context!\n";
3929+
llvm::dbgs() << "Decl: " << importedName.getDeclName().getBaseIdentifier().str() << "\n";
3930+
llvm::dbgs() << "Decl: "; decl->dump();
3931+
llvm::dbgs() << "Efective ctx: "; importedName.getEffectiveContext().DC->dumpAsDecl();
3932+
llvm::dbgs() << "Decl ctx: "; decl->getDeclContext()->dumpAsDecl();
3933+
llvm_unreachable("");
3934+
}
3935+
#endif
3936+
39263937
SmallVector<GenericTypeParamDecl *, 4> genericParams;
39273938
for (auto &param : *decl->getTemplateParameters()) {
39283939
auto genericParamDecl =

0 commit comments

Comments
 (0)