From 141b448ee9a864c4735fb66dbc5a3f1ec4920ad5 Mon Sep 17 00:00:00 2001 From: George Karpenkov Date: Sat, 15 Sep 2018 02:02:56 +0000 Subject: [PATCH] [analyzer] Use correct end-of-line character when printing statements for exploded graph Prevents bad centering. Differential Revision: https://reviews.llvm.org/D51825 llvm-svn: 342312 --- clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp index 2893cd3..b8ec06e9 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -3071,12 +3071,14 @@ struct DOTGraphTraits : public DefaultDOTGraphTraits { if (const auto *C = dyn_cast(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 << ":"; @@ -3108,7 +3110,8 @@ struct DOTGraphTraits : 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()) -- 2.7.4