Index: lib/StaticAnalyzer/Core/ExprEngine.cpp =================================================================== --- lib/StaticAnalyzer/Core/ExprEngine.cpp +++ lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -138,9 +138,17 @@ const ConstructionContextItem &getItem() const { return Impl.first; } const LocationContext *getLocationContext() const { return Impl.second; } + ASTContext &getASTContext() const { + return getLocationContext()->getDecl()->getASTContext(); + } + void print(llvm::raw_ostream &OS, PrinterHelper *Helper, PrintingPolicy &PP) { - OS << '(' << getLocationContext() << ',' << getAnyASTNodePtr() << ',' - << getItem().getKindAsString(); + OS << "(LC" << getLocationContext()->getID() << ','; + if (const Stmt *S = getItem().getStmtOrNull()) + OS << 'S' << S->getID(getASTContext()); + else + OS << 'I' << getItem().getCXXCtorInitializer()->getID(getASTContext()); + OS << ',' << getItem().getKindAsString(); if (getItem().getKind() == ConstructionContextItem::ArgumentKind) OS << " #" << getItem().getIndex(); OS << ") "; Index: test/Analysis/dump_egraph.cpp =================================================================== --- test/Analysis/dump_egraph.cpp +++ test/Analysis/dump_egraph.cpp @@ -2,14 +2,21 @@ // RUN: cat %t.dot | FileCheck %s // REQUIRES: asserts - struct S { ~S(); }; +struct T { + S s; + T() : s() {} +}; + void foo() { // Test that dumping symbols conjured on null statements doesn't crash. - S s; + T t; } -// CHECK: conj_$0\{int, LC1, no stmt, #1\} +// CHECK: (LC1,S{{[0-9]*}},construct into local variable) T t;\n : &t +// CHECK: (LC2,I{{[0-9]*}},construct into member variable) s : &t-\>s +// CHECK: conj_$5\{int, LC3, no stmt, #1\} +