Skip to content

Commit 64ed4ed

Browse files
authored
[clang][dataflow] Expand debug dumping of Values. (#71527)
1 parent 446e11a commit 64ed4ed

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

clang/lib/Analysis/FlowSensitive/Value.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,18 @@ bool areEquivalentValues(const Value &Val1, const Value &Val2) {
3434

3535
raw_ostream &operator<<(raw_ostream &OS, const Value &Val) {
3636
switch (Val.getKind()) {
37-
case Value::Kind::Pointer: {
38-
const auto *PV = dyn_cast<PointerValue>(&Val);
39-
return OS << "Pointer(" << &PV->getPointeeLoc() << ")";
40-
}
41-
// FIXME: support remaining cases.
42-
default:
43-
return OS << debugString(Val.getKind());
37+
case Value::Kind::Integer:
38+
return OS << "Integer(@" << &Val << ")";
39+
case Value::Kind::Pointer:
40+
return OS << "Pointer(" << &cast<PointerValue>(Val).getPointeeLoc() << ")";
41+
case Value::Kind::Record:
42+
return OS << "Record(" << &cast<RecordValue>(Val).getLoc() << ")";
43+
case Value::Kind::TopBool:
44+
return OS << "TopBool(" << cast<TopBoolValue>(Val).getAtom() << ")";
45+
case Value::Kind::AtomicBool:
46+
return OS << "AtomicBool(" << cast<AtomicBoolValue>(Val).getAtom() << ")";
47+
case Value::Kind::FormulaBool:
48+
return OS << "FormulaBool(" << cast<FormulaBoolValue>(Val).formula() << ")";
4449
}
4550
}
4651

0 commit comments

Comments
 (0)