18
18
#include " clang/Analysis/FlowSensitive/Value.h"
19
19
#include " llvm/ADT/DenseMap.h"
20
20
#include " llvm/ADT/STLExtras.h"
21
+ #include " llvm/ADT/StringRef.h"
21
22
#include " llvm/ADT/StringSet.h"
22
23
#include " llvm/Support/ErrorHandling.h"
23
24
#include " llvm/Support/FormatAdapters.h"
@@ -31,7 +32,33 @@ using llvm::AlignStyle;
31
32
using llvm::fmt_pad;
32
33
using llvm::formatv;
33
34
34
- std::string debugString (Solver::Result::Assignment Assignment) {
35
+ llvm::StringRef debugString (Value::Kind Kind) {
36
+ switch (Kind) {
37
+ case Value::Kind::Integer:
38
+ return " Integer" ;
39
+ case Value::Kind::Reference:
40
+ return " Reference" ;
41
+ case Value::Kind::Pointer:
42
+ return " Pointer" ;
43
+ case Value::Kind::Struct:
44
+ return " Struct" ;
45
+ case Value::Kind::AtomicBool:
46
+ return " AtomicBool" ;
47
+ case Value::Kind::Conjunction:
48
+ return " Conjunction" ;
49
+ case Value::Kind::Disjunction:
50
+ return " Disjunction" ;
51
+ case Value::Kind::Negation:
52
+ return " Negation" ;
53
+ case Value::Kind::Implication:
54
+ return " Implication" ;
55
+ case Value::Kind::Biconditional:
56
+ return " Biconditional" ;
57
+ }
58
+ llvm_unreachable (" Unhandled value kind" );
59
+ }
60
+
61
+ llvm::StringRef debugString (Solver::Result::Assignment Assignment) {
35
62
switch (Assignment) {
36
63
case Solver::Result::Assignment::AssignedFalse:
37
64
return " False" ;
@@ -41,7 +68,7 @@ std::string debugString(Solver::Result::Assignment Assignment) {
41
68
llvm_unreachable (" Booleans can only be assigned true/false" );
42
69
}
43
70
44
- std::string debugString (Solver::Result::Status Status) {
71
+ llvm::StringRef debugString (Solver::Result::Status Status) {
45
72
switch (Status) {
46
73
case Solver::Result::Status::Satisfiable:
47
74
return " Satisfiable" ;
0 commit comments