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);
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);
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits