wyt created this revision.
Herald added subscribers: martong, xazax.hun.
Herald added a reviewer: NoQ.
Herald added a project: All.
wyt requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131891

Files:
  clang/include/clang/Analysis/FlowSensitive/DebugSupport.h
  clang/lib/Analysis/FlowSensitive/DebugSupport.cpp


Index: clang/lib/Analysis/FlowSensitive/DebugSupport.cpp
===================================================================
--- clang/lib/Analysis/FlowSensitive/DebugSupport.cpp
+++ clang/lib/Analysis/FlowSensitive/DebugSupport.cpp
@@ -31,6 +31,32 @@
 using llvm::fmt_pad;
 using llvm::formatv;
 
+std::string debugString(Value::Kind Kind) {
+  switch (Kind) {
+  case Value::Kind::Integer:
+    return "Integer";
+  case Value::Kind::Reference:
+    return "Reference";
+  case Value::Kind::Pointer:
+    return "Pointer";
+  case Value::Kind::Struct:
+    return "Struct";
+  case Value::Kind::AtomicBool:
+    return "AtomicBool";
+  case Value::Kind::Conjunction:
+    return "Conjunction";
+  case Value::Kind::Disjunction:
+    return "Disjunction";
+  case Value::Kind::Negation:
+    return "Negation";
+  case Value::Kind::Implication:
+    return "Implication";
+  case Value::Kind::Biconditional:
+    return "Biconditional";
+  }
+  llvm_unreachable("Unhandled value kind");
+}
+
 std::string debugString(Solver::Result::Assignment Assignment) {
   switch (Assignment) {
   case Solver::Result::Assignment::AssignedFalse:
Index: clang/include/clang/Analysis/FlowSensitive/DebugSupport.h
===================================================================
--- clang/include/clang/Analysis/FlowSensitive/DebugSupport.h
+++ clang/include/clang/Analysis/FlowSensitive/DebugSupport.h
@@ -24,6 +24,9 @@
 namespace clang {
 namespace dataflow {
 
+/// Returns a string representation of a value kind.
+std::string debugString(Value::Kind Kind);
+
 /// Returns a string representation of a boolean assignment to true or false.
 std::string debugString(Solver::Result::Assignment Assignment);
 


Index: clang/lib/Analysis/FlowSensitive/DebugSupport.cpp
===================================================================
--- clang/lib/Analysis/FlowSensitive/DebugSupport.cpp
+++ clang/lib/Analysis/FlowSensitive/DebugSupport.cpp
@@ -31,6 +31,32 @@
 using llvm::fmt_pad;
 using llvm::formatv;
 
+std::string debugString(Value::Kind Kind) {
+  switch (Kind) {
+  case Value::Kind::Integer:
+    return "Integer";
+  case Value::Kind::Reference:
+    return "Reference";
+  case Value::Kind::Pointer:
+    return "Pointer";
+  case Value::Kind::Struct:
+    return "Struct";
+  case Value::Kind::AtomicBool:
+    return "AtomicBool";
+  case Value::Kind::Conjunction:
+    return "Conjunction";
+  case Value::Kind::Disjunction:
+    return "Disjunction";
+  case Value::Kind::Negation:
+    return "Negation";
+  case Value::Kind::Implication:
+    return "Implication";
+  case Value::Kind::Biconditional:
+    return "Biconditional";
+  }
+  llvm_unreachable("Unhandled value kind");
+}
+
 std::string debugString(Solver::Result::Assignment Assignment) {
   switch (Assignment) {
   case Solver::Result::Assignment::AssignedFalse:
Index: clang/include/clang/Analysis/FlowSensitive/DebugSupport.h
===================================================================
--- clang/include/clang/Analysis/FlowSensitive/DebugSupport.h
+++ clang/include/clang/Analysis/FlowSensitive/DebugSupport.h
@@ -24,6 +24,9 @@
 namespace clang {
 namespace dataflow {
 
+/// Returns a string representation of a value kind.
+std::string debugString(Value::Kind Kind);
+
 /// Returns a string representation of a boolean assignment to true or false.
 std::string debugString(Solver::Result::Assignment Assignment);
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to