[analyzer] Use correct end-of-line character when printing statements for exploded...
authorGeorge Karpenkov <ekarpenkov@apple.com>
Sat, 15 Sep 2018 02:02:56 +0000 (02:02 +0000)
committerGeorge Karpenkov <ekarpenkov@apple.com>
Sat, 15 Sep 2018 02:02:56 +0000 (02:02 +0000)
Prevents bad centering.

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

llvm-svn: 342312

clang/lib/StaticAnalyzer/Core/ExprEngine.cpp

index 2893cd3..b8ec06e 100644 (file)
@@ -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 << ":";
@@ -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>())