[PATCH] D146527: [dataflow] Log flow condition to the correct stream.
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 21 07:35:16 PDT 2023
sammccall created this revision.
sammccall added a reviewer: mboehme.
Herald added subscribers: martong, xazax.hun.
Herald added a reviewer: NoQ.
Herald added a project: All.
sammccall 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/D146527
Files:
clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h
clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp
clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
Index: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
===================================================================
--- clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
+++ clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
@@ -812,7 +812,7 @@
}
OS << "FlowConditionToken:\n";
- DACtx->dumpFlowCondition(*FlowConditionToken);
+ DACtx->dumpFlowCondition(*FlowConditionToken, OS);
}
void Environment::dump() const {
Index: clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp
===================================================================
--- clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp
+++ clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp
@@ -342,7 +342,8 @@
return substituteBoolValue(*ConstraintsIt->second, SubstitutionsCache);
}
-void DataflowAnalysisContext::dumpFlowCondition(AtomicBoolValue &Token) {
+void DataflowAnalysisContext::dumpFlowCondition(AtomicBoolValue &Token,
+ llvm::raw_ostream &OS) {
llvm::DenseSet<BoolValue *> Constraints = {&Token};
llvm::DenseSet<AtomicBoolValue *> VisitedTokens;
addTransitiveFlowConditionConstraints(Token, Constraints, VisitedTokens);
@@ -350,7 +351,7 @@
llvm::DenseMap<const AtomicBoolValue *, std::string> AtomNames = {
{&getBoolLiteralValue(false), "False"},
{&getBoolLiteralValue(true), "True"}};
- llvm::dbgs() << debugString(Constraints, AtomNames);
+ OS << debugString(Constraints, AtomNames);
}
const ControlFlowContext *
Index: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h
===================================================================
--- clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h
+++ clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h
@@ -264,7 +264,8 @@
/// `Val2` imposed by the flow condition.
bool equivalentBoolValues(BoolValue &Val1, BoolValue &Val2);
- LLVM_DUMP_METHOD void dumpFlowCondition(AtomicBoolValue &Token);
+ LLVM_DUMP_METHOD void dumpFlowCondition(AtomicBoolValue &Token,
+ llvm::raw_ostream &OS = llvm::dbgs());
/// Returns the `ControlFlowContext` registered for `F`, if any. Otherwise,
/// returns null.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146527.506972.patch
Type: text/x-patch
Size: 2288 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230321/3f6caa29/attachment.bin>
More information about the cfe-commits
mailing list