File tree Expand file tree Collapse file tree 2 files changed +15
-18
lines changed Expand file tree Collapse file tree 2 files changed +15
-18
lines changed Original file line number Diff line number Diff line change @@ -37,14 +37,6 @@ class SummaryAttr {
3737};
3838
3939class NoWriteGlobalAttr : public SummaryAttr {
40- class Callback : public ast_matchers ::MatchFinder::MatchCallback {
41- public:
42- bool WriteGlobal = false ;
43-
44- void
45- run (const ast_matchers::MatchFinder::MatchResult &Result) override final ;
46- };
47-
4840 NoWriteGlobalAttr () : SummaryAttr(NO_WRITE_GLOBAL, " no_write_global" ) {}
4941
5042public:
Original file line number Diff line number Diff line change 22#include " clang/Sema/SummaryContext.h"
33
44namespace clang {
5- void NoWriteGlobalAttr::Callback::run (
6- const ast_matchers::MatchFinder::MatchResult &Result) {
7- const auto *Assignment = Result.Nodes .getNodeAs <BinaryOperator>(" assignment" );
8- if (!Assignment)
9- return ;
10-
11- WriteGlobal = true ;
12- }
13-
145bool NoWriteGlobalAttr::infer (const FunctionDecl *FD) const {
156 using namespace ast_matchers ;
167 MatchFinder Finder;
17- Callback CB;
8+
9+ class Callback : public ast_matchers ::MatchFinder::MatchCallback {
10+ public:
11+ bool WriteGlobal = false ;
12+
13+ void
14+ run (const ast_matchers::MatchFinder::MatchResult &Result) override final {
15+ const auto *Assignment =
16+ Result.Nodes .getNodeAs <BinaryOperator>(" assignment" );
17+ if (!Assignment)
18+ return ;
19+
20+ WriteGlobal = true ;
21+ }
22+ } CB;
1823
1924 Finder.addMatcher (
2025 functionDecl (forEachDescendant (
You can’t perform that action at this time.
0 commit comments