]> granicus.if.org Git - clang/commitdiff
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342312 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/ExprEngine.cpp

index 2893cd3a07888e883c7385e6c791433beb76839f..b8ec06e9b98dd3a7a87c9a656aa976c58612f7fd 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>())