[PATCH] D147032: [clang][dataflow][NFC] Put TransferVisitor in an unnamed namespace.
Martin Böhme via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 28 01:08:14 PDT 2023
mboehme created this revision.
Herald added subscribers: martong, xazax.hun.
Herald added a reviewer: NoQ.
Herald added a project: All.
mboehme requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
This avoids the risk of ODR violations.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D147032
Files:
clang/lib/Analysis/FlowSensitive/Transfer.cpp
Index: clang/lib/Analysis/FlowSensitive/Transfer.cpp
===================================================================
--- clang/lib/Analysis/FlowSensitive/Transfer.cpp
+++ clang/lib/Analysis/FlowSensitive/Transfer.cpp
@@ -129,6 +129,8 @@
return &UnpackedVal;
}
+namespace {
+
class TransferVisitor : public ConstStmtVisitor<TransferVisitor> {
public:
TransferVisitor(const StmtToEnvMap &StmtToEnv, Environment &Env)
@@ -874,6 +876,8 @@
Environment &Env;
};
+} // namespace
+
void transfer(const StmtToEnvMap &StmtToEnv, const Stmt &S, Environment &Env) {
TransferVisitor(StmtToEnv, Env).Visit(&S);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147032.508923.patch
Type: text/x-patch
Size: 625 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230328/431e567a/attachment.bin>
More information about the cfe-commits
mailing list