r342312 - [analyzer] Use correct end-of-line character when printing statements for exploded graph
George Karpenkov via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 14 19:02:56 PDT 2018
Author: george.karpenkov
Date: Fri Sep 14 19:02:56 2018
New Revision: 342312
URL: http://llvm.org/viewvc/llvm-project?rev=342312&view=rev
Log:
[analyzer] Use correct end-of-line character when printing statements for exploded graph
Prevents bad centering.
Differential Revision: https://reviews.llvm.org/D51825
Modified:
cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp
Modified: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp?rev=342312&r1=342311&r2=342312&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp Fri Sep 14 19:02:56 2018
@@ -3071,12 +3071,14 @@ struct DOTGraphTraits<ExplodedNode*> : p
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 << ":";
@@ -3108,7 +3110,8 @@ struct DOTGraphTraits<ExplodedNode*> : p
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>())
More information about the cfe-commits
mailing list