Skip to content

Commit

Permalink
[analyzer] Use correct end-of-line character when printing statements…
Browse files Browse the repository at this point in the history
… for exploded graph

Prevents bad centering.

Differential Revision: https://reviews.llvm.org/D51825

llvm-svn: 342312
  • Loading branch information
George Karpenkov committed Sep 15, 2018
1 parent 64885ae commit 141b448
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
Expand Up @@ -3071,12 +3071,14 @@ struct DOTGraphTraits<ExplodedNode*> : public DefaultDOTGraphTraits {
if (const auto *C = dyn_cast<CaseStmt>(Label)) {
Out << "\\lcase ";
if (C->getLHS())
C->getLHS()->printPretty(Out, nullptr,
Context.getPrintingPolicy());
C->getLHS()->printPretty(
Out, nullptr, Context.getPrintingPolicy(),
/*Indentation=*/0, /*NewlineSymbol=*/"\\l");

if (const Stmt *RHS = C->getRHS()) {
Out << " .. ";
RHS->printPretty(Out, nullptr, Context.getPrintingPolicy());
RHS->printPretty(Out, nullptr, Context.getPrintingPolicy(),
/*Indetation=*/0, /*NewlineSymbol=*/"\\l");
}

Out << ":";
Expand Down Expand Up @@ -3108,7 +3110,8 @@ struct DOTGraphTraits<ExplodedNode*> : public DefaultDOTGraphTraits {

Out << S->getStmtClassName() << ' '
<< S->getID(Context) << " (" << (const void *)S << ") ";
S->printPretty(Out, nullptr, Context.getPrintingPolicy());
S->printPretty(Out, /*helper=*/nullptr, Context.getPrintingPolicy(),
/*Indentation=*/2, /*NewlineSymbol=*/"\\l");
printLocation(Out, S->getBeginLoc());

if (Loc.getAs<PreStmt>())
Expand Down

0 comments on commit 141b448

Please sign in to comment.