@@ -68,7 +68,7 @@ template <typename L> class EdgeFunction {
6868 // jump functions that describe the effects of everlonger sequences of code.
6969 //
7070 [[nodiscard]] virtual EdgeFunctionPtrType
71- composeWith (EdgeFunctionPtrType secondFunction ) = 0 ;
71+ composeWith (EdgeFunctionPtrType SecondFunction ) = 0 ;
7272
7373 //
7474 // This function describes the join of the two edge functions this and
@@ -83,7 +83,8 @@ template <typename L> class EdgeFunction {
8383 equal_to // NOLINT - would break too many client analyses
8484 (EdgeFunctionPtrType OtherFunction) const = 0 ;
8585
86- virtual void print (std::ostream &OS, bool IsForDebug = false ) const {
86+ virtual void print (std::ostream &OS,
87+ [[maybe_unused]] bool IsForDebug = false ) const {
8788 OS << " EdgeFunction" ;
8889 }
8990
@@ -114,31 +115,34 @@ class AllTop : public EdgeFunction<L>,
114115 using typename EdgeFunction<L>::EdgeFunctionPtrType;
115116
116117private:
117- const L topElement ;
118+ const L TopElement ;
118119
119120public:
120- AllTop (L topElement ) : topElement(topElement ) {}
121+ AllTop (const L TopElement ) : TopElement(std::move(TopElement) ) {}
121122
122123 ~AllTop () override = default ;
123124
124- L computeTarget (L source ) override { return topElement ; }
125+ L computeTarget (L /* Source */ ) override { return TopElement ; }
125126
126- EdgeFunctionPtrType composeWith (EdgeFunctionPtrType secondFunction) override {
127+ EdgeFunctionPtrType
128+ composeWith (EdgeFunctionPtrType /* SecondFunction*/ ) override {
127129 return this ->shared_from_this ();
128130 }
129131
130- EdgeFunctionPtrType joinWith (EdgeFunctionPtrType otherFunction ) override {
131- return otherFunction ;
132+ EdgeFunctionPtrType joinWith (EdgeFunctionPtrType OtherFunction ) override {
133+ return OtherFunction ;
132134 }
133135
134- bool equal_to (EdgeFunctionPtrType other) const override {
135- if (auto *alltop = dynamic_cast <AllTop<L> *>(other.get ())) {
136- return (alltop->topElement == topElement);
136+ [[nodiscard]] bool equal_to // NOLINT - would break too many client analyses
137+ (EdgeFunctionPtrType Other) const override {
138+ if (auto *Alltop = dynamic_cast <AllTop<L> *>(Other.get ())) {
139+ return (Alltop->TopElement == TopElement);
137140 }
138141 return false ;
139142 }
140143
141- void print (std::ostream &OS, bool isForDebug = false ) const override {
144+ void print (std::ostream &OS,
145+ [[maybe_unused]] bool IsForDebug = false ) const override {
142146 OS << " AllTop" ;
143147 }
144148};
@@ -152,47 +156,48 @@ class AllBottom : public EdgeFunction<L>,
152156 using typename EdgeFunction<L>::EdgeFunctionPtrType;
153157
154158private:
155- const L bottomElement ;
159+ const L BottomElement ;
156160
157161public:
158- AllBottom (L bottomElement ) : bottomElement(bottomElement ) {}
162+ AllBottom (const L BottomElement ) : BottomElement(std::move(BottomElement) ) {}
159163
160164 ~AllBottom () override = default ;
161165
162- L computeTarget (L source ) override { return bottomElement ; }
166+ L computeTarget (L /* Source */ ) override { return BottomElement ; }
163167
164- EdgeFunctionPtrType composeWith (EdgeFunctionPtrType secondFunction ) override {
165- if (auto *ab = dynamic_cast <AllBottom<L> *>(secondFunction .get ())) {
168+ EdgeFunctionPtrType composeWith (EdgeFunctionPtrType SecondFunction ) override {
169+ if (auto *AB = dynamic_cast <AllBottom<L> *>(SecondFunction .get ())) {
166170 return this ->shared_from_this ();
167171 }
168- if (auto *ei = dynamic_cast <EdgeIdentity<L> *>(secondFunction .get ())) {
172+ if (auto *EI = dynamic_cast <EdgeIdentity<L> *>(SecondFunction .get ())) {
169173 return this ->shared_from_this ();
170174 }
171- return secondFunction ->composeWith (this ->shared_from_this ());
175+ return SecondFunction ->composeWith (this ->shared_from_this ());
172176 }
173177
174- EdgeFunctionPtrType joinWith (EdgeFunctionPtrType otherFunction ) override {
175- if (otherFunction .get () == this ||
176- otherFunction ->equal_to (this ->shared_from_this ())) {
178+ EdgeFunctionPtrType joinWith (EdgeFunctionPtrType OtherFunction ) override {
179+ if (OtherFunction .get () == this ||
180+ OtherFunction ->equal_to (this ->shared_from_this ())) {
177181 return this ->shared_from_this ();
178182 }
179- if (auto *alltop = dynamic_cast <AllTop<L> *>(otherFunction .get ())) {
183+ if (auto *Alltop = dynamic_cast <AllTop<L> *>(OtherFunction .get ())) {
180184 return this ->shared_from_this ();
181185 }
182- if (auto *ei = dynamic_cast <EdgeIdentity<L> *>(otherFunction .get ())) {
186+ if (auto *EI = dynamic_cast <EdgeIdentity<L> *>(OtherFunction .get ())) {
183187 return this ->shared_from_this ();
184188 }
185189 return this ->shared_from_this ();
186190 }
187191
188- bool equal_to (EdgeFunctionPtrType other) const override {
189- if (auto *allbottom = dynamic_cast <AllBottom<L> *>(other.get ())) {
190- return (allbottom->bottomElement == bottomElement);
192+ [[nodiscard]] bool equal_to // NOLINT - would break too many client analyses
193+ (EdgeFunctionPtrType Other) const override {
194+ if (auto *AB = dynamic_cast <AllBottom<L> *>(Other.get ())) {
195+ return (AB->BottomElement == BottomElement);
191196 }
192197 return false ;
193198 }
194199
195- void print (std::ostream &OS, bool isForDebug = false ) const override {
200+ void print (std::ostream &OS, bool /* IsForDebug = false*/ ) const override {
196201 OS << " AllBottom" ;
197202 }
198203};
@@ -207,44 +212,45 @@ class EdgeIdentity : public EdgeFunction<L>,
207212 EdgeIdentity () = default ;
208213
209214public:
210- EdgeIdentity (const EdgeIdentity &ei ) = delete ;
215+ EdgeIdentity (const EdgeIdentity &EI ) = delete ;
211216
212- EdgeIdentity &operator =(const EdgeIdentity &ei ) = delete ;
217+ EdgeIdentity &operator =(const EdgeIdentity &EI ) = delete ;
213218
214219 ~EdgeIdentity () override = default ;
215220
216- L computeTarget (L source ) override { return source ; }
221+ L computeTarget (L Source ) override { return Source ; }
217222
218- EdgeFunctionPtrType composeWith (EdgeFunctionPtrType secondFunction ) override {
219- return secondFunction ;
223+ EdgeFunctionPtrType composeWith (EdgeFunctionPtrType SecondFunction ) override {
224+ return SecondFunction ;
220225 }
221226
222- EdgeFunctionPtrType joinWith (EdgeFunctionPtrType otherFunction ) override {
223- if ((otherFunction .get () == this ) ||
224- otherFunction ->equal_to (this ->shared_from_this ())) {
227+ EdgeFunctionPtrType joinWith (EdgeFunctionPtrType OtherFunction ) override {
228+ if ((OtherFunction .get () == this ) ||
229+ OtherFunction ->equal_to (this ->shared_from_this ())) {
225230 return this ->shared_from_this ();
226231 }
227- if (auto *ab = dynamic_cast <AllBottom<L> *>(otherFunction .get ())) {
228- return otherFunction ;
232+ if (auto *AB = dynamic_cast <AllBottom<L> *>(OtherFunction .get ())) {
233+ return OtherFunction ;
229234 }
230- if (auto *at = dynamic_cast <AllTop<L> *>(otherFunction .get ())) {
235+ if (auto *AT = dynamic_cast <AllTop<L> *>(OtherFunction .get ())) {
231236 return this ->shared_from_this ();
232237 }
233238 // do not know how to join; hence ask other function to decide on this
234- return otherFunction ->joinWith (this ->shared_from_this ());
239+ return OtherFunction ->joinWith (this ->shared_from_this ());
235240 }
236241
237- bool equal_to (EdgeFunctionPtrType other) const override {
238- return this == other.get ();
242+ [[nodiscard]] bool equal_to // NOLINT - would break too many client analyses
243+ (EdgeFunctionPtrType Other) const override {
244+ return this == Other.get ();
239245 }
240246
241247 static EdgeFunctionPtrType getInstance () {
242248 // implement singleton C++11 thread-safe (see Scott Meyers)
243- static EdgeFunctionPtrType instance (new EdgeIdentity<L>());
244- return instance ;
249+ static EdgeFunctionPtrType Instance (new EdgeIdentity<L>());
250+ return Instance ;
245251 }
246252
247- void print (std::ostream &OS, bool isForDebug = false ) const override {
253+ void print (std::ostream &OS, bool /* IsForDebug = false*/ ) const override {
248254 OS << " EdgeIdentity" ;
249255 }
250256};
@@ -523,11 +529,10 @@ class EdgeFunctionSingletonFactory {
523529 auto SearchVal = Storage.find (K);
524530 if (SearchVal != Storage.end () && !SearchVal->second .expired ()) {
525531 return SearchVal->second .lock ();
526- } else {
527- auto NewEdgeFunc = std::make_shared<EdgeFunctionType>(K);
528- Storage[K] = NewEdgeFunc;
529- return NewEdgeFunc;
530532 }
533+ auto NewEdgeFunc = std::make_shared<EdgeFunctionType>(K);
534+ Storage[K] = NewEdgeFunc;
535+ return NewEdgeFunc;
531536 }
532537
533538 // Initialize a cleaner thread to automatically remove unused/expired
0 commit comments