[PATCH] D146625: [dataflow] handle missing case in value debug strings

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 24 20:28:26 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd630134f1f1f: [dataflow] handle missing case in value debug strings (authored by sammccall).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146625/new/

https://reviews.llvm.org/D146625

Files:
  clang/lib/Analysis/FlowSensitive/DebugSupport.cpp
  clang/unittests/Analysis/FlowSensitive/DebugSupportTest.cpp


Index: clang/unittests/Analysis/FlowSensitive/DebugSupportTest.cpp
===================================================================
--- clang/unittests/Analysis/FlowSensitive/DebugSupportTest.cpp
+++ clang/unittests/Analysis/FlowSensitive/DebugSupportTest.cpp
@@ -27,7 +27,14 @@
   auto B = Ctx.atom();
 
   auto Expected = R"(B0)";
-  debugString(*B);
+  EXPECT_THAT(debugString(*B), StrEq(Expected));
+}
+
+TEST(BoolValueDebugStringTest, Top) {
+  ConstraintContext Ctx;
+  auto B = Ctx.top();
+
+  auto Expected = R"(top)";
   EXPECT_THAT(debugString(*B), StrEq(Expected));
 }
 
Index: clang/lib/Analysis/FlowSensitive/DebugSupport.cpp
===================================================================
--- clang/lib/Analysis/FlowSensitive/DebugSupport.cpp
+++ clang/lib/Analysis/FlowSensitive/DebugSupport.cpp
@@ -106,6 +106,10 @@
       S = getAtomName(&cast<AtomicBoolValue>(B));
       break;
     }
+    case Value::Kind::TopBool: {
+      S = "top";
+      break;
+    }
     case Value::Kind::Conjunction: {
       auto &C = cast<ConjunctionValue>(B);
       auto L = debugString(C.getLeftSubValue(), Depth + 1);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146625.508274.patch
Type: text/x-patch
Size: 1127 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230325/8485df2d/attachment.bin>


More information about the cfe-commits mailing list