@@ -314,51 +314,95 @@ class APValue {
314
314
DataType Data;
315
315
316
316
public:
317
+ // / Creates an empty APValue of type None.
317
318
APValue () : Kind(None) {}
319
+ // / Creates an integer APValue holding the given value.
318
320
explicit APValue (APSInt I) : Kind(None) {
319
321
MakeInt (); setInt (std::move (I));
320
322
}
323
+ // / Creates a float APValue holding the given value.
321
324
explicit APValue (APFloat F) : Kind(None) {
322
325
MakeFloat (); setFloat (std::move (F));
323
326
}
327
+ // / Creates a fixed-point APValue holding the given value.
324
328
explicit APValue (APFixedPoint FX) : Kind(None) {
325
329
MakeFixedPoint (std::move (FX));
326
330
}
331
+ // / Creates a vector APValue with \p N elements. The elements
332
+ // / are read from \p E.
327
333
explicit APValue (const APValue *E, unsigned N) : Kind(None) {
328
334
MakeVector (); setVector (E, N);
329
335
}
336
+ // / Creates an integer complex APValue with the given real and imaginary
337
+ // / values.
330
338
APValue (APSInt R, APSInt I) : Kind(None) {
331
339
MakeComplexInt (); setComplexInt (std::move (R), std::move (I));
332
340
}
341
+ // / Creates a float complex APValue with the given real and imaginary values.
333
342
APValue (APFloat R, APFloat I) : Kind(None) {
334
343
MakeComplexFloat (); setComplexFloat (std::move (R), std::move (I));
335
344
}
336
345
APValue (const APValue &RHS);
337
346
APValue (APValue &&RHS);
338
- APValue (LValueBase B, const CharUnits &O, NoLValuePath N,
347
+ // / Creates an lvalue APValue without an lvalue path.
348
+ // / \param Base The base of the lvalue.
349
+ // / \param Offset The offset of the lvalue.
350
+ // / \param IsNullPtr Whether this lvalue is a null pointer.
351
+ APValue (LValueBase Base, const CharUnits &Offset, NoLValuePath,
339
352
bool IsNullPtr = false )
340
353
: Kind(None) {
341
- MakeLValue (); setLValue (B, O, N, IsNullPtr);
342
- }
343
- APValue (LValueBase B, const CharUnits &O, ArrayRef<LValuePathEntry> Path,
344
- bool OnePastTheEnd, bool IsNullPtr = false )
354
+ MakeLValue ();
355
+ setLValue (Base, Offset, NoLValuePath{}, IsNullPtr);
356
+ }
357
+ // / Creates an lvalue APValue with an lvalue path.
358
+ // / \param Base The base of the lvalue.
359
+ // / \param Offset The offset of the lvalue.
360
+ // / \param Path The lvalue path.
361
+ // / \param OnePastTheEnd Whether this lvalue is one-past-the-end of the
362
+ // / subobject it points to.
363
+ // / \param IsNullPtr Whether this lvalue is a null pointer.
364
+ APValue (LValueBase Base, const CharUnits &Offset,
365
+ ArrayRef<LValuePathEntry> Path, bool OnePastTheEnd,
366
+ bool IsNullPtr = false )
345
367
: Kind(None) {
346
- MakeLValue (); setLValue (B, O, Path, OnePastTheEnd, IsNullPtr);
347
- }
368
+ MakeLValue ();
369
+ setLValue (Base, Offset, Path, OnePastTheEnd, IsNullPtr);
370
+ }
371
+ // / Creates a new array APValue.
372
+ // / \param UninitArray Marker. Pass an empty UninitArray.
373
+ // / \param InitElts Number of elements you're going to initialize in the
374
+ // / array.
375
+ // / \param Size Full size of the array.
348
376
APValue (UninitArray, unsigned InitElts, unsigned Size ) : Kind(None) {
349
377
MakeArray (InitElts, Size );
350
378
}
351
- APValue (UninitStruct, unsigned B, unsigned M) : Kind(None) {
352
- MakeStruct (B, M);
353
- }
354
- explicit APValue (const FieldDecl *D, const APValue &V = APValue())
379
+ // / Creates a new struct APValue.
380
+ // / \param UninitStruct Marker. Pass an empty UninitStruct.
381
+ // / \param NumBases Number of bases.
382
+ // / \param NumMembers Number of members.
383
+ APValue (UninitStruct, unsigned NumBases, unsigned NumMembers) : Kind(None) {
384
+ MakeStruct (NumBases, NumMembers);
385
+ }
386
+ // / Creates a new union APValue.
387
+ // / \param ActiveDecl The FieldDecl of the active union member.
388
+ // / \param ActiveValue The value of the active union member.
389
+ explicit APValue (const FieldDecl *ActiveDecl,
390
+ const APValue &ActiveValue = APValue())
355
391
: Kind(None) {
356
- MakeUnion (); setUnion (D, V);
392
+ MakeUnion ();
393
+ setUnion (ActiveDecl, ActiveValue);
357
394
}
395
+ // / Creates a new member pointer APValue.
396
+ // / \param Member Declaration of the member
397
+ // / \param IsDerivedMember Whether member is a derived one.
398
+ // / \param Path The path of the member.
358
399
APValue (const ValueDecl *Member, bool IsDerivedMember,
359
400
ArrayRef<const CXXRecordDecl*> Path) : Kind(None) {
360
401
MakeMemberPointer (Member, IsDerivedMember, Path);
361
402
}
403
+ // / Creates a new address label diff APValue.
404
+ // / \param LHSExpr The left-hand side of the difference.
405
+ // / \param RHSExpr The right-hand side of the difference.
362
406
APValue (const AddrLabelExpr* LHSExpr, const AddrLabelExpr* RHSExpr)
363
407
: Kind(None) {
364
408
MakeAddrLabelDiff (); setAddrLabelDiff (LHSExpr, RHSExpr);
0 commit comments