@@ -190,7 +190,7 @@ Value *lowerObjectSizeCall(
190
190
// / SizeOffsetType - A base template class for the object size visitors. Used
191
191
// / here as a self-documenting way to handle the values rather than using a
192
192
// / \p std::pair.
193
- template <typename T, class C > class SizeOffsetType {
193
+ template <typename T, class C > struct SizeOffsetType {
194
194
public:
195
195
T Size;
196
196
T Offset;
@@ -213,13 +213,11 @@ template <typename T, class C> class SizeOffsetType {
213
213
214
214
// / SizeOffsetAPInt - Used by \p ObjectSizeOffsetVisitor, which works with
215
215
// / \p APInts.
216
- class SizeOffsetAPInt : public SizeOffsetType <APInt, SizeOffsetAPInt> {
217
- friend class SizeOffsetType ;
218
- static bool known (APInt V) { return V.getBitWidth () > 1 ; }
219
-
220
- public:
216
+ struct SizeOffsetAPInt : public SizeOffsetType <APInt, SizeOffsetAPInt> {
221
217
SizeOffsetAPInt () = default ;
222
218
SizeOffsetAPInt (APInt Size, APInt Offset) : SizeOffsetType(Size, Offset) {}
219
+
220
+ static bool known (APInt V) { return V.getBitWidth () > 1 ; }
223
221
};
224
222
225
223
// / Evaluate the size and offset of an object pointed to by a Value*
@@ -274,30 +272,26 @@ class ObjectSizeOffsetVisitor
274
272
275
273
// / SizeOffsetValue - Used by \p ObjectSizeOffsetEvaluator, which works with
276
274
// / \p Values.
277
- class SizeOffsetWeakTrackingVH ;
278
- class SizeOffsetValue : public SizeOffsetType <Value *, SizeOffsetValue> {
279
- friend class SizeOffsetType ;
280
- static bool known (Value *V) { return V != nullptr ; }
281
-
282
- public:
275
+ struct SizeOffsetWeakTrackingVH ;
276
+ struct SizeOffsetValue : public SizeOffsetType <Value *, SizeOffsetValue> {
283
277
SizeOffsetValue () : SizeOffsetType(nullptr , nullptr ) {}
284
278
SizeOffsetValue (Value *Size, Value *Offset) : SizeOffsetType(Size, Offset) {}
285
279
SizeOffsetValue (const SizeOffsetWeakTrackingVH &SOT);
280
+
281
+ static bool known (Value *V) { return V != nullptr ; }
286
282
};
287
283
288
284
// / SizeOffsetWeakTrackingVH - Used by \p ObjectSizeOffsetEvaluator in a
289
285
// / \p DenseMap.
290
- class SizeOffsetWeakTrackingVH
286
+ struct SizeOffsetWeakTrackingVH
291
287
: public SizeOffsetType<WeakTrackingVH, SizeOffsetWeakTrackingVH> {
292
- friend class SizeOffsetType ;
293
- static bool known (WeakTrackingVH V) { return V.pointsToAliveValue (); }
294
-
295
- public:
296
288
SizeOffsetWeakTrackingVH () : SizeOffsetType(nullptr , nullptr ) {}
297
289
SizeOffsetWeakTrackingVH (Value *Size, Value *Offset)
298
290
: SizeOffsetType(Size, Offset) {}
299
291
SizeOffsetWeakTrackingVH (const SizeOffsetValue &SOV)
300
292
: SizeOffsetType(SOV.Size, SOV.Offset) {}
293
+
294
+ static bool known (WeakTrackingVH V) { return V.pointsToAliveValue (); }
301
295
};
302
296
303
297
// / Evaluate the size and offset of an object pointed to by a Value*.
0 commit comments