Skip to content

[clang][dataflow] Remove RecordValue.getLog() usage in HTMLLogger #65645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class ModelDumper {

switch (V.getKind()) {
case Value::Kind::Integer:
case Value::Kind::Record:
case Value::Kind::TopBool:
case Value::Kind::AtomicBool:
case Value::Kind::FormulaBool:
Expand All @@ -103,14 +104,6 @@ class ModelDumper {
JOS.attributeObject(
"pointee", [&] { dump(cast<PointerValue>(V).getPointeeLoc()); });
break;
case Value::Kind::Record:
for (const auto &Child : cast<RecordValue>(V).getLoc().children())
JOS.attributeObject("f:" + Child.first->getNameAsString(), [&] {
if (Child.second)
if (Value *Val = Env.getValue(*Child.second))
dump(*Val);
});
break;
}

for (const auto& Prop : V.properties())
Expand All @@ -136,6 +129,15 @@ class ModelDumper {
JOS.attribute("type", L.getType().getAsString());
if (auto *V = Env.getValue(L))
dump(*V);

if (auto *RLoc = dyn_cast<RecordStorageLocation>(&L)) {
for (const auto &Child : RLoc->children())
JOS.attributeObject("f:" + Child.first->getNameAsString(), [&] {
if (Child.second)
if (Value *Val = Env.getValue(*Child.second))
dump(*Val);
});
}
}

llvm::DenseSet<const void*> Visited;
Expand Down