Skip to content

Commit e791535

Browse files
authored
[clang][dataflow] Remove RecordValue.getLog() usage in HTMLLogger (#65645)
We can dump the same information from RecordStorageLocation. Tested the behavior before and after patch, that generates the field values in the HTML in both cases (and also made sure that removing the relevant code makes the field values in the HTML go away)
1 parent 6ba42ae commit e791535

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class ModelDumper {
9595

9696
switch (V.getKind()) {
9797
case Value::Kind::Integer:
98+
case Value::Kind::Record:
9899
case Value::Kind::TopBool:
99100
case Value::Kind::AtomicBool:
100101
case Value::Kind::FormulaBool:
@@ -103,14 +104,6 @@ class ModelDumper {
103104
JOS.attributeObject(
104105
"pointee", [&] { dump(cast<PointerValue>(V).getPointeeLoc()); });
105106
break;
106-
case Value::Kind::Record:
107-
for (const auto &Child : cast<RecordValue>(V).getLoc().children())
108-
JOS.attributeObject("f:" + Child.first->getNameAsString(), [&] {
109-
if (Child.second)
110-
if (Value *Val = Env.getValue(*Child.second))
111-
dump(*Val);
112-
});
113-
break;
114107
}
115108

116109
for (const auto& Prop : V.properties())
@@ -136,6 +129,15 @@ class ModelDumper {
136129
JOS.attribute("type", L.getType().getAsString());
137130
if (auto *V = Env.getValue(L))
138131
dump(*V);
132+
133+
if (auto *RLoc = dyn_cast<RecordStorageLocation>(&L)) {
134+
for (const auto &Child : RLoc->children())
135+
JOS.attributeObject("f:" + Child.first->getNameAsString(), [&] {
136+
if (Child.second)
137+
if (Value *Val = Env.getValue(*Child.second))
138+
dump(*Val);
139+
});
140+
}
139141
}
140142

141143
llvm::DenseSet<const void*> Visited;

0 commit comments

Comments
 (0)