Store SourceManager pointer on PrintingPolicy in the case where we're dumping,

and remove ASTContext reference (which was frequently bound to a dereferenced
null pointer) from the recursive lump of printPretty functions. In so doing,
fix (at least) one case where we intended to use the 'dump' mode, but that
failed because a null ASTContext reference had been passed in.

llvm-svn: 162011
This commit is contained in:
Richard Smith
2012-08-16 03:56:14 +00:00
parent 426feb61b9
commit 235341bc88
13 changed files with 64 additions and 83 deletions

View File

@@ -214,7 +214,7 @@ void CallEvent::dump() const {
void CallEvent::dump(raw_ostream &Out) const {
ASTContext &Ctx = getState()->getStateManager().getContext();
if (const Expr *E = getOriginExpr()) {
E->printPretty(Out, Ctx, 0, Ctx.getPrintingPolicy());
E->printPretty(Out, 0, Ctx.getPrintingPolicy());
Out << "\n";
return;
}
@@ -860,4 +860,3 @@ CallEventManager::getCaller(const StackFrameContext *CalleeCtx,
return getCXXDestructorCall(Dtor, Trigger, ThisVal.getAsRegion(),
State, CallerCtx);
}