Skip to content

Commit ce86772

Browse files
zoecarverhyp
authored andcommitted
no merge: add some debugging for linux.
1 parent 7f72f23 commit ce86772

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
@@ -3887,6 +3887,17 @@ namespace {
38873887
auto dc = Impl.importDeclContextOf(
38883888
decl, importedName.getEffectiveContext());
38893889

3890+
#ifndef NDEBUG
3891+
if (dc == nullptr) {
3892+
llvm::dbgs() << "No decl context!\n";
3893+
llvm::dbgs() << "Decl: " << importedName.getDeclName().getBaseIdentifier().str() << "\n";
3894+
llvm::dbgs() << "Decl: "; decl->dump();
3895+
llvm::dbgs() << "Efective ctx: "; importedName.getEffectiveContext().DC->dumpAsDecl();
3896+
llvm::dbgs() << "Decl ctx: "; decl->getDeclContext()->dumpAsDecl();
3897+
llvm_unreachable("");
3898+
}
3899+
#endif
3900+
38903901
SmallVector<GenericTypeParamDecl *, 4> genericParams;
38913902
for (auto &param : *decl->getTemplateParameters()) {
38923903
auto genericParamDecl =

0 commit comments

Comments
 (0)