]> granicus.if.org Git - clang/commitdiff
When visualizing ExplodedNodes created by GRExprEngine, color nodes with
authorTed Kremenek <kremenek@apple.com>
Thu, 14 Feb 2008 22:54:53 +0000 (22:54 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 14 Feb 2008 22:54:53 +0000 (22:54 +0000)
null-dereferences or bad control-flow red.

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

Analysis/GRExprEngine.cpp

index 4418afddb6cb4bae321e3b8e942cca29985c92e1..15f1aa2e373cafe23abf6da9c95243fea3d8f72b 100644 (file)
@@ -1114,7 +1114,16 @@ struct VISIBILITY_HIDDEN DOTGraphTraits<GRExprEngine::NodeTy*> :
         Out << (*J)->toString();
       }    
     }
-  }    
+  }
+    
+  static std::string getNodeAttributes(const GRExprEngine::NodeTy* N, void*) {
+    
+    if (GraphPrintCheckerState->isImplicitNullDeref(N) ||
+        GraphPrintCheckerState->isExplicitNullDeref(N))
+      return "color=\"red\",style=\"filled\"";
+    
+    return "";
+  }
     
   static std::string getNodeLabel(const GRExprEngine::NodeTy* N, void*) {
     std::ostringstream Out;