@@ -128,30 +128,36 @@ class PreservedAnalyses {
128
128
}
129
129
130
130
// / Mark an analysis as preserved.
131
- template <typename AnalysisT> void preserve () { preserve (AnalysisT::ID ()); }
131
+ template <typename AnalysisT> PreservedAnalyses &preserve () {
132
+ preserve (AnalysisT::ID ());
133
+ return *this ;
134
+ }
132
135
133
136
// / Given an analysis's ID, mark the analysis as preserved, adding it
134
137
// / to the set.
135
- void preserve (AnalysisKey *ID) {
138
+ PreservedAnalyses & preserve (AnalysisKey *ID) {
136
139
// Clear this ID from the explicit not-preserved set if present.
137
140
NotPreservedAnalysisIDs.erase (ID);
138
141
139
142
// If we're not already preserving all analyses (other than those in
140
143
// NotPreservedAnalysisIDs).
141
144
if (!areAllPreserved ())
142
145
PreservedIDs.insert (ID);
146
+ return *this ;
143
147
}
144
148
145
149
// / Mark an analysis set as preserved.
146
- template <typename AnalysisSetT> void preserveSet () {
150
+ template <typename AnalysisSetT> PreservedAnalyses & preserveSet () {
147
151
preserveSet (AnalysisSetT::ID ());
152
+ return *this ;
148
153
}
149
154
150
155
// / Mark an analysis set as preserved using its ID.
151
- void preserveSet (AnalysisSetKey *ID) {
156
+ PreservedAnalyses & preserveSet (AnalysisSetKey *ID) {
152
157
// If we're not already in the saturated 'all' state, add this set.
153
158
if (!areAllPreserved ())
154
159
PreservedIDs.insert (ID);
160
+ return *this ;
155
161
}
156
162
157
163
// / Mark an analysis as abandoned.
@@ -161,7 +167,10 @@ class PreservedAnalyses {
161
167
// /
162
168
// / Note that you can only abandon a specific analysis, not a *set* of
163
169
// / analyses.
164
- template <typename AnalysisT> void abandon () { abandon (AnalysisT::ID ()); }
170
+ template <typename AnalysisT> PreservedAnalyses &abandon () {
171
+ abandon (AnalysisT::ID ());
172
+ return *this ;
173
+ }
165
174
166
175
// / Mark an analysis as abandoned using its ID.
167
176
// /
@@ -170,9 +179,10 @@ class PreservedAnalyses {
170
179
// /
171
180
// / Note that you can only abandon a specific analysis, not a *set* of
172
181
// / analyses.
173
- void abandon (AnalysisKey *ID) {
182
+ PreservedAnalyses & abandon (AnalysisKey *ID) {
174
183
PreservedIDs.erase (ID);
175
184
NotPreservedAnalysisIDs.insert (ID);
185
+ return *this ;
176
186
}
177
187
178
188
// / Intersect this set with another in place.
0 commit comments