clang 24.0.0git
APValue.h
Go to the documentation of this file.
1//===--- APValue.h - Union class for APFloat/APSInt/Complex -----*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file defines the APValue class.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_AST_APVALUE_H
14#define LLVM_CLANG_AST_APVALUE_H
15
16#include "clang/AST/CharUnits.h"
18#include "clang/Basic/LLVM.h"
19#include "llvm/ADT/APFixedPoint.h"
20#include "llvm/ADT/APFloat.h"
21#include "llvm/ADT/APSInt.h"
22#include "llvm/ADT/FoldingSet.h"
23#include "llvm/ADT/PointerIntPair.h"
24#include "llvm/ADT/PointerUnion.h"
25#include "llvm/ADT/STLFunctionalExtras.h"
26#include "llvm/ADT/bit.h"
27#include "llvm/Support/AlignOf.h"
28#include "llvm/Support/Compiler.h"
29
30namespace clang {
31namespace serialization {
32template <typename T> class BasicReaderBase;
33} // end namespace serialization
34
35 class AddrLabelExpr;
36 class ASTContext;
37 class CXXRecordDecl;
38 class Decl;
40 class Expr;
41 class FieldDecl;
42 struct PrintingPolicy;
43 class Type;
44 class ValueDecl;
45 class QualType;
46
47/// Symbolic representation of typeid(T) for some type T.
49 const Type *T;
50
51public:
52 TypeInfoLValue() : T() {}
53 explicit TypeInfoLValue(const Type *T);
54
55 const Type *getType() const { return T; }
56 explicit operator bool() const { return T; }
57
58 const void *getOpaqueValue() const { return T; }
61 V.T = reinterpret_cast<const Type*>(Value);
62 return V;
63 }
64
65 void print(llvm::raw_ostream &Out, const PrintingPolicy &Policy) const;
66};
67
68/// Kind of source for a dynamic allocation.
69enum class DynAllocKind {
70 New, // new expression
71 ArrayNew, // new[] expression
72 StdAllocator, // std::allocator::allocate call
73 None, // not a dynamic allocation
74 BuiltinOperatorNew, // __operator_builtin_new call
76};
77
78/// Symbolic representation of a dynamic allocation.
80public:
81 static constexpr int NumLowBitsAvailable = 2;
82 static constexpr int NumAllocKindBits = 3;
83 static_assert((1 << NumAllocKindBits) - 1 >=
84 static_cast<int>(DynAllocKind::ALLOC_KIND_MAX));
85
86private:
87 // lower NumAlignmentBits: alignment exponent
88 // remaining bits: allocation index incremented by one
89 // value of zero indicates distinct empty state
90 LLVM_PREFERRED_TYPE(DynAllocKind)
91 uintptr_t AllocKind : NumAllocKindBits;
92 uintptr_t Index : sizeof(uintptr_t) * CHAR_BIT - NumAllocKindBits;
93
94public:
95 DynamicAllocLValue() : AllocKind(0), Index(0) {}
96 explicit DynamicAllocLValue(unsigned Idx, DynAllocKind AllocKind)
97 : AllocKind(llvm::to_underlying(AllocKind)), Index(Idx + 1) {
98 assert(Idx <= getMaxIndex() && "Index is out of range");
99 }
100 unsigned getIndex() const { return Index - 1; }
102 return static_cast<DynAllocKind>(AllocKind);
103 }
104
105 explicit operator bool() const { return Index != 0; }
106
107 const void *getOpaqueValue() const {
108 return reinterpret_cast<const void *>(
109 (Index << NumAllocKindBits | AllocKind) << NumLowBitsAvailable);
110 }
113 uintptr_t Combined =
114 reinterpret_cast<uintptr_t>(Value) >> NumLowBitsAvailable;
115 V.AllocKind = Combined & ((1 << NumAllocKindBits) - 1);
116 V.Index = Combined >> NumAllocKindBits;
117 return V;
118 }
119
121 return (std::numeric_limits<uintptr_t>::max() >>
123 1;
124 }
125};
126static_assert(sizeof(DynamicAllocLValue) == sizeof(uintptr_t));
127}
128
129namespace llvm {
130template<> struct PointerLikeTypeTraits<clang::TypeInfoLValue> {
132 return V.getOpaqueValue();
133 }
137 // Validated by static_assert in APValue.cpp; hardcoded to avoid needing
138 // to include Type.h.
139 static constexpr int NumLowBitsAvailable = 3;
140};
141
142template<> struct PointerLikeTypeTraits<clang::DynamicAllocLValue> {
144 return V.getOpaqueValue();
145 }
149 static constexpr int NumLowBitsAvailable =
151};
152}
153
154namespace clang {
155/// APValue - This class implements a discriminated union of [uninitialized]
156/// [APSInt] [APFloat], [Complex APSInt] [Complex APFloat], [Expr + Offset],
157/// [Vector: N * APValue], [Array: N * APValue]
158class LLVM_ATTRIBUTE_WARN_UNUSED APValue {
159 typedef llvm::APFixedPoint APFixedPoint;
160 typedef llvm::APSInt APSInt;
161 typedef llvm::APFloat APFloat;
162public:
164 /// There is no such object (it's outside its lifetime).
166 /// This object has an indeterminate value (C++ [basic.indet]).
182 };
183
184 class alignas(uint64_t) LValueBase {
185 typedef llvm::PointerUnion<const ValueDecl *, const Expr *, TypeInfoLValue,
187 PtrTy;
188
189 public:
191 LValueBase(const ValueDecl *P, unsigned I = 0, unsigned V = 0);
192 LValueBase(const Expr *P, unsigned I = 0, unsigned V = 0);
193 static LValueBase getDynamicAlloc(DynamicAllocLValue LV, QualType Type);
194 static LValueBase getTypeInfo(TypeInfoLValue LV, QualType TypeInfo);
195
196 void Profile(llvm::FoldingSetNodeID &ID) const;
197
198 template <class T> bool is() const { return isa<T>(Ptr); }
199
200 template <class T> T get() const { return cast<T>(Ptr); }
201
202 template <class T> T dyn_cast() const {
203 return dyn_cast_if_present<T>(Ptr);
204 }
205
206 void *getOpaqueValue() const;
207
208 bool isNull() const;
209
210 explicit operator bool() const;
211
212 unsigned getCallIndex() const;
213 unsigned getVersion() const;
214 QualType getTypeInfoType() const;
215 QualType getDynamicAllocType() const;
216
217 QualType getType() const;
218
219 friend bool operator==(const LValueBase &LHS, const LValueBase &RHS);
220 friend bool operator!=(const LValueBase &LHS, const LValueBase &RHS) {
221 return !(LHS == RHS);
222 }
223 friend llvm::hash_code hash_value(const LValueBase &Base);
224 friend struct llvm::DenseMapInfo<LValueBase>;
225
226 private:
227 PtrTy Ptr;
228 struct LocalState {
229 unsigned CallIndex, Version;
230 };
231 union {
232 LocalState Local;
233 /// The type std::type_info, if this is a TypeInfoLValue.
235 /// The QualType, if this is a DynamicAllocLValue.
237 };
238 };
239
240 /// A FieldDecl or CXXRecordDecl, along with a flag indicating whether we
241 /// mean a virtual or non-virtual base class subobject.
242 typedef llvm::PointerIntPair<const Decl *, 1, bool> BaseOrMemberType;
243
244 /// A non-discriminated union of a base, field, or array index.
246 static_assert(sizeof(uintptr_t) <= sizeof(uint64_t),
247 "pointer doesn't fit in 64 bits?");
248 uint64_t Value;
249
250 public:
251 LValuePathEntry() : Value() {}
252 LValuePathEntry(BaseOrMemberType BaseOrMember);
255 Result.Value = Index;
256 return Result;
257 }
258
260 return BaseOrMemberType::getFromOpaqueValue(
261 reinterpret_cast<void *>(Value));
262 }
263 uint64_t getAsArrayIndex() const { return Value; }
264
265 void Profile(llvm::FoldingSetNodeID &ID) const;
266
268 return A.Value == B.Value;
269 }
271 return A.Value != B.Value;
272 }
273 friend llvm::hash_code hash_value(LValuePathEntry A) {
274 return llvm::hash_value(A.Value);
275 }
276 };
286 struct NoLValuePath {};
287 struct UninitArray {};
288 struct UninitStruct {};
290
291 template <typename Impl> friend class clang::serialization::BasicReaderBase;
292 friend class ASTImporter;
293 friend class ASTNodeImporter;
294
295private:
296 ValueKind Kind;
297 bool AllowConstexprUnknown : 1;
298
299 struct ComplexAPSInt {
300 APSInt Real, Imag;
301 ComplexAPSInt() : Real(1), Imag(1) {}
302 };
303 struct ComplexAPFloat {
304 APFloat Real, Imag;
305 ComplexAPFloat() : Real(0.0), Imag(0.0) {}
306 };
307 struct LV;
308 struct Vec {
309 APValue *Elts = nullptr;
310 unsigned NumElts = 0;
311 Vec() = default;
312 Vec(const Vec &) = delete;
313 Vec &operator=(const Vec &) = delete;
314 ~Vec() { delete[] Elts; }
315 };
316 struct Mat {
317 APValue *Elts = nullptr;
318 unsigned NumRows = 0;
319 unsigned NumCols = 0;
320 Mat() = default;
321 Mat(const Mat &) = delete;
322 Mat &operator=(const Mat &) = delete;
323 ~Mat() { delete[] Elts; }
324 };
325 struct Arr {
326 APValue *Elts;
327 unsigned NumElts, ArrSize;
328 Arr(unsigned NumElts, unsigned ArrSize);
329 Arr(const Arr &) = delete;
330 Arr &operator=(const Arr &) = delete;
331 ~Arr();
332 };
333 struct StructData {
334 APValue *Elts;
335 unsigned NumBases;
336 unsigned NumFields;
337 unsigned NumVirtualBases;
338 StructData(unsigned NumBases, unsigned NumFields, unsigned NumVirtualBases);
339 StructData(const StructData &) = delete;
340 StructData &operator=(const StructData &) = delete;
341 ~StructData();
342 };
343 struct UnionData {
344 const FieldDecl *Field;
345 APValue *Value;
346 UnionData();
347 UnionData(const UnionData &) = delete;
348 UnionData &operator=(const UnionData &) = delete;
349 ~UnionData();
350 };
351 struct AddrLabelDiffData {
352 const AddrLabelExpr* LHSExpr;
353 const AddrLabelExpr* RHSExpr;
354 };
355 struct ReflectionData {
356 // OperandKind will eventually have support for
357 // Null, TypeSourceInfo, TemplateReference, NamespaceReference, DeclRefExpr.
358 // Operand stores the opaque pointer of the reflection operand.
359 // Depending on the value of OperandKind, we can perform the
360 // corresponding cast to the associated type.
361 // If OperandKind is Null, then the ReflectionData represents
362 // a null reflection, and therefore Operand should be a nullptr.
363 ReflectionKind OperandKind;
364 const void *Operand;
365 };
366 struct MemberPointerData;
367
368 // We ensure elsewhere that Data is big enough for LV and MemberPointerData.
369 typedef llvm::AlignedCharArrayUnion<
370 void *, APSInt, APFloat, ComplexAPSInt, ComplexAPFloat, Vec, Mat, Arr,
371 StructData, UnionData, AddrLabelDiffData, ReflectionData>
372 DataType;
373 static const size_t DataSize = sizeof(DataType);
374
375 DataType Data;
376
377public:
378 bool allowConstexprUnknown() const { return AllowConstexprUnknown; }
379
380 void setConstexprUnknown(bool IsConstexprUnknown = true) {
381 AllowConstexprUnknown = IsConstexprUnknown;
382 }
383
384 /// Creates an empty APValue of type None.
385 APValue() : Kind(None), AllowConstexprUnknown(false) {}
386 /// Creates an integer APValue holding the given value.
387 explicit APValue(APSInt I) : Kind(None), AllowConstexprUnknown(false) {
388 MakeInt(std::move(I));
389 }
390 /// Creates a float APValue holding the given value.
391 explicit APValue(APFloat F) : Kind(None), AllowConstexprUnknown(false) {
392 MakeFloat(std::move(F));
393 }
394 /// Creates a fixed-point APValue holding the given value.
395 explicit APValue(APFixedPoint FX) : Kind(None), AllowConstexprUnknown(false) {
396 MakeFixedPoint(std::move(FX));
397 }
398 /// Creates a vector APValue with \p N elements. The elements
399 /// are read from \p E.
400 explicit APValue(const APValue *E, unsigned N)
401 : Kind(None), AllowConstexprUnknown(false) {
402 MakeVector(); setVector(E, N);
403 }
404 /// Creates a matrix APValue with given dimensions. The elements
405 /// are read from \p E and assumed to be in row-major order.
406 explicit APValue(const APValue *E, unsigned NumRows, unsigned NumCols)
407 : Kind(None), AllowConstexprUnknown(false) {
408 MakeMatrix();
409 setMatrix(E, NumRows, NumCols);
410 }
411 /// Creates an integer complex APValue with the given real and imaginary
412 /// values.
413 APValue(APSInt R, APSInt I) : Kind(None), AllowConstexprUnknown(false) {
414 MakeComplexInt(); setComplexInt(std::move(R), std::move(I));
415 }
416 /// Creates a float complex APValue with the given real and imaginary values.
417 APValue(APFloat R, APFloat I) : Kind(None), AllowConstexprUnknown(false) {
418 MakeComplexFloat(); setComplexFloat(std::move(R), std::move(I));
419 }
420 APValue(const APValue &RHS);
421 APValue(APValue &&RHS);
422 /// Creates an lvalue APValue without an lvalue path.
423 /// \param Base The base of the lvalue.
424 /// \param Offset The offset of the lvalue.
425 /// \param IsNullPtr Whether this lvalue is a null pointer.
427 bool IsNullPtr = false)
428 : Kind(None), AllowConstexprUnknown(false) {
429 MakeLValue();
430 setLValue(Base, Offset, NoLValuePath{}, IsNullPtr);
431 }
432 /// Creates an lvalue APValue with an lvalue path.
433 /// \param Base The base of the lvalue.
434 /// \param Offset The offset of the lvalue.
435 /// \param Path The lvalue path.
436 /// \param OnePastTheEnd Whether this lvalue is one-past-the-end of the
437 /// subobject it points to.
438 /// \param IsNullPtr Whether this lvalue is a null pointer.
440 bool OnePastTheEnd, bool IsNullPtr = false)
441 : Kind(None), AllowConstexprUnknown(false) {
442 MakeLValue();
443 setLValue(Base, Offset, Path, OnePastTheEnd, IsNullPtr);
444 }
445 /// Creates a constexpr unknown lvalue APValue.
446 /// \param Base The base of the lvalue.
447 /// \param Offset The offset of the lvalue.
448 /// \param IsNullPtr Whether this lvalue is a null pointer.
450 bool IsNullPtr = false)
451 : Kind(None), AllowConstexprUnknown(true) {
452 MakeLValue();
453 setLValue(Base, Offset, NoLValuePath{}, IsNullPtr);
454 }
455
456 /// Creates a new array APValue.
457 /// \param UninitArray Marker. Pass an empty UninitArray.
458 /// \param InitElts Number of elements you're going to initialize in the
459 /// array.
460 /// \param Size Full size of the array.
461 APValue(UninitArray, unsigned InitElts, unsigned Size)
462 : Kind(None), AllowConstexprUnknown(false) {
463 MakeArray(InitElts, Size);
464 }
465
466 /// Creates a new Reflection APValue.
467 /// \param OperandKind The kind of reflection.
468 /// \param Operand The entity being reflected.
469 APValue(ReflectionKind OperandKind, const void *Operand) : Kind(None) {
470 MakeReflection(OperandKind, Operand);
471 }
472
473 /// Creates a new struct APValue.
474 /// \param UninitStruct Marker. Pass an empty UninitStruct.
475 /// \param NumBases Number of bases.
476 /// \param NumMembers Number of members.
477 /// \param NumVirtualBases Number of virtual bases.
478 APValue(UninitStruct, unsigned NumBases, unsigned NumMembers,
479 unsigned NumVirtualBases = 0)
480 : Kind(None), AllowConstexprUnknown(false) {
481 MakeStruct(NumBases, NumMembers, NumVirtualBases);
482 }
483 /// Creates a new union APValue.
484 /// \param ActiveDecl The FieldDecl of the active union member.
485 /// \param ActiveValue The value of the active union member.
486 explicit APValue(const FieldDecl *ActiveDecl,
487 const APValue &ActiveValue = APValue())
488 : Kind(None), AllowConstexprUnknown(false) {
489 MakeUnion();
490 setUnion(ActiveDecl, ActiveValue);
491 }
492 /// Creates a new member pointer APValue.
493 /// \param Member Declaration of the member
494 /// \param IsDerivedMember Whether member is a derived one.
495 /// \param Path The path of the member.
496 APValue(const ValueDecl *Member, bool IsDerivedMember,
498 : Kind(None), AllowConstexprUnknown(false) {
499 MakeMemberPointer(Member, IsDerivedMember, Path);
500 }
501 /// Creates a new address label diff APValue.
502 /// \param LHSExpr The left-hand side of the difference.
503 /// \param RHSExpr The right-hand side of the difference.
504 APValue(const AddrLabelExpr *LHSExpr, const AddrLabelExpr *RHSExpr)
505 : Kind(None), AllowConstexprUnknown(false) {
506 MakeAddrLabelDiff(); setAddrLabelDiff(LHSExpr, RHSExpr);
507 }
510 Result.Kind = Indeterminate;
511 return Result;
512 }
513
514 APValue &operator=(const APValue &RHS);
515 APValue &operator=(APValue &&RHS);
516
518 if (Kind != None && Kind != Indeterminate)
519 DestroyDataAndMakeUninit();
520 }
521
522 /// Returns whether the object performed allocations.
523 ///
524 /// If APValues are constructed via placement new, \c needsCleanup()
525 /// indicates whether the destructor must be called in order to correctly
526 /// free all allocated memory.
527 bool needsCleanup() const;
528
529 /// Swaps the contents of this and the given APValue.
530 void swap(APValue &RHS);
531
532 /// profile this value. There is no guarantee that values of different
533 /// types will not produce the same profiled value, so the type should
534 /// typically also be profiled if it's not implied by the context.
535 void Profile(llvm::FoldingSetNodeID &ID) const;
536
537 ValueKind getKind() const { return Kind; }
538
539 /// Visit this value and every recursively nested value. Iteration order
540 /// is unspecified.
541 ///
542 /// Visitation stops if \p Visitor returns false.
543 void visit(llvm::function_ref<bool(const APValue &)> Visitor) const;
544
545 bool isAbsent() const { return Kind == None; }
546 bool isIndeterminate() const { return Kind == Indeterminate; }
547 bool hasValue() const { return Kind != None && Kind != Indeterminate; }
548
549 bool isInt() const { return Kind == Int; }
550 bool isFloat() const { return Kind == Float; }
551 bool isFixedPoint() const { return Kind == FixedPoint; }
552 bool isComplexInt() const { return Kind == ComplexInt; }
553 bool isComplexFloat() const { return Kind == ComplexFloat; }
554 bool isLValue() const { return Kind == LValue; }
555 bool isVector() const { return Kind == Vector; }
556 bool isMatrix() const { return Kind == Matrix; }
557 bool isArray() const { return Kind == Array; }
558 bool isStruct() const { return Kind == Struct; }
559 bool isUnion() const { return Kind == Union; }
560 bool isMemberPointer() const { return Kind == MemberPointer; }
561 bool isAddrLabelDiff() const { return Kind == AddrLabelDiff; }
562 bool isReflection() const { return Kind == Reflection; }
563
564 void dump() const;
565 void dump(raw_ostream &OS, const ASTContext &Context) const;
566
567 void printPretty(raw_ostream &OS, const ASTContext &Ctx, QualType Ty) const;
568 void printPretty(raw_ostream &OS, const PrintingPolicy &Policy, QualType Ty,
569 const ASTContext *Ctx = nullptr) const;
570
571 std::string getAsString(const ASTContext &Ctx, QualType Ty) const;
572
573 /// Returns the contents of an array of integers (e.g. an evaluated character
574 /// array) as a string, with each element truncated to a char.
575 std::string getCharArrayAsString() const;
576
577 APSInt &getInt() {
578 assert(isInt() && "Invalid accessor");
579 return *(APSInt *)(char *)&Data;
580 }
581 const APSInt &getInt() const {
582 return const_cast<APValue*>(this)->getInt();
583 }
584
585 /// Try to convert this value to an integral constant. This works if it's an
586 /// integer, null pointer, or offset from a null pointer. Returns true on
587 /// success.
588 bool toIntegralConstant(APSInt &Result, QualType SrcTy,
589 const ASTContext &Ctx) const;
590
591 APFloat &getFloat() {
592 assert(isFloat() && "Invalid accessor");
593 return *(APFloat *)(char *)&Data;
594 }
595 const APFloat &getFloat() const {
596 return const_cast<APValue*>(this)->getFloat();
597 }
598
599 APFixedPoint &getFixedPoint() {
600 assert(isFixedPoint() && "Invalid accessor");
601 return *(APFixedPoint *)(char *)&Data;
602 }
603 const APFixedPoint &getFixedPoint() const {
604 return const_cast<APValue *>(this)->getFixedPoint();
605 }
606
608 assert(isComplexInt() && "Invalid accessor");
609 return ((ComplexAPSInt *)(char *)&Data)->Real;
610 }
611 const APSInt &getComplexIntReal() const {
612 return const_cast<APValue*>(this)->getComplexIntReal();
613 }
614
616 assert(isComplexInt() && "Invalid accessor");
617 return ((ComplexAPSInt *)(char *)&Data)->Imag;
618 }
619 const APSInt &getComplexIntImag() const {
620 return const_cast<APValue*>(this)->getComplexIntImag();
621 }
622
624 assert(isComplexFloat() && "Invalid accessor");
625 return ((ComplexAPFloat *)(char *)&Data)->Real;
626 }
627 const APFloat &getComplexFloatReal() const {
628 return const_cast<APValue*>(this)->getComplexFloatReal();
629 }
630
632 assert(isComplexFloat() && "Invalid accessor");
633 return ((ComplexAPFloat *)(char *)&Data)->Imag;
634 }
635 const APFloat &getComplexFloatImag() const {
636 return const_cast<APValue*>(this)->getComplexFloatImag();
637 }
638
639 const LValueBase getLValueBase() const;
640 CharUnits &getLValueOffset();
642 return const_cast<APValue*>(this)->getLValueOffset();
643 }
644 bool isLValueOnePastTheEnd() const;
645 bool hasLValuePath() const;
646 ArrayRef<LValuePathEntry> getLValuePath() const;
647 unsigned getLValueCallIndex() const;
648 unsigned getLValueVersion() const;
649 bool isNullPointer() const;
650
651 APValue &getVectorElt(unsigned I) {
652 assert(isVector() && "Invalid accessor");
653 assert(I < getVectorLength() && "Index out of range");
654 return ((Vec *)(char *)&Data)->Elts[I];
655 }
656 const APValue &getVectorElt(unsigned I) const {
657 return const_cast<APValue*>(this)->getVectorElt(I);
658 }
659 unsigned getVectorLength() const {
660 assert(isVector() && "Invalid accessor");
661 return ((const Vec *)(const void *)&Data)->NumElts;
662 }
663
664 unsigned getMatrixNumRows() const {
665 assert(isMatrix() && "Invalid accessor");
666 return ((const Mat *)(const void *)&Data)->NumRows;
667 }
668 unsigned getMatrixNumColumns() const {
669 assert(isMatrix() && "Invalid accessor");
670 return ((const Mat *)(const void *)&Data)->NumCols;
671 }
672 unsigned getMatrixNumElements() const {
674 }
675 APValue &getMatrixElt(unsigned Idx) {
676 assert(isMatrix() && "Invalid accessor");
677 assert(Idx < getMatrixNumElements() && "Index out of range");
678 return ((Mat *)(char *)&Data)->Elts[Idx];
679 }
680 const APValue &getMatrixElt(unsigned Idx) const {
681 return const_cast<APValue *>(this)->getMatrixElt(Idx);
682 }
683 APValue &getMatrixElt(unsigned Row, unsigned Col) {
684 assert(isMatrix() && "Invalid accessor");
685 assert(Row < getMatrixNumRows() && "Row index out of range");
686 assert(Col < getMatrixNumColumns() && "Column index out of range");
687 // Matrix elements are stored in row-major order.
688 unsigned I = Row * getMatrixNumColumns() + Col;
689 return getMatrixElt(I);
690 }
691 const APValue &getMatrixElt(unsigned Row, unsigned Col) const {
692 return const_cast<APValue *>(this)->getMatrixElt(Row, Col);
693 }
694
696 assert(isArray() && "Invalid accessor");
697 assert(I < getArrayInitializedElts() && "Index out of range");
698 return ((Arr *)(char *)&Data)->Elts[I];
699 }
700 const APValue &getArrayInitializedElt(unsigned I) const {
701 return const_cast<APValue*>(this)->getArrayInitializedElt(I);
702 }
703 bool hasArrayFiller() const {
705 }
707 assert(isArray() && "Invalid accessor");
708 assert(hasArrayFiller() && "No array filler");
709 return ((Arr *)(char *)&Data)->Elts[getArrayInitializedElts()];
710 }
711 const APValue &getArrayFiller() const {
712 return const_cast<APValue*>(this)->getArrayFiller();
713 }
714 unsigned getArrayInitializedElts() const {
715 assert(isArray() && "Invalid accessor");
716 return ((const Arr *)(const void *)&Data)->NumElts;
717 }
718 unsigned getArraySize() const {
719 assert(isArray() && "Invalid accessor");
720 return ((const Arr *)(const void *)&Data)->ArrSize;
721 }
722
723 unsigned getStructNumBases() const {
724 assert(isStruct() && "Invalid accessor");
725 return ((const StructData *)(const char *)&Data)->NumBases;
726 }
727 unsigned getStructNumFields() const {
728 assert(isStruct() && "Invalid accessor");
729 return ((const StructData *)(const char *)&Data)->NumFields;
730 }
731 unsigned getStructNumVirtualBases() const {
732 assert(isStruct() && "Invalid accessor");
733 return ((const StructData *)(const char *)&Data)->NumVirtualBases;
734 }
735 APValue &getStructBase(unsigned i) {
736 assert(isStruct() && "Invalid accessor");
737 assert(i < getStructNumBases() && "base class index OOB");
738 return ((StructData *)(char *)&Data)->Elts[i];
739 }
740 APValue &getStructField(unsigned i) {
741 assert(isStruct() && "Invalid accessor");
742 assert(i < getStructNumFields() && "field index OOB");
743 return ((StructData *)(char *)&Data)->Elts[getStructNumBases() + i];
744 }
746 assert(isStruct() && "Invalid accessor");
747 assert(i < getStructNumVirtualBases() && "virtual base class index OOB");
748 return ((StructData *)(char *)&Data)
749 ->Elts[getStructNumBases() + getStructNumFields() + i];
750 }
751 const APValue &getStructBase(unsigned i) const {
752 return const_cast<APValue*>(this)->getStructBase(i);
753 }
754 const APValue &getStructField(unsigned i) const {
755 return const_cast<APValue*>(this)->getStructField(i);
756 }
757 const APValue &getStructVirtualBase(unsigned i) const {
758 return const_cast<APValue *>(this)->getStructVirtualBase(i);
759 }
760
761 const FieldDecl *getUnionField() const {
762 assert(isUnion() && "Invalid accessor");
763 return ((const UnionData *)(const char *)&Data)->Field;
764 }
766 assert(isUnion() && "Invalid accessor");
767 return *((UnionData *)(char *)&Data)->Value;
768 }
769 const APValue &getUnionValue() const {
770 return const_cast<APValue*>(this)->getUnionValue();
771 }
772
773 const ValueDecl *getMemberPointerDecl() const;
774 bool isMemberPointerToDerivedMember() const;
775 ArrayRef<const CXXRecordDecl*> getMemberPointerPath() const;
776
778 assert(isAddrLabelDiff() && "Invalid accessor");
779 return ((const AddrLabelDiffData *)(const char *)&Data)->LHSExpr;
780 }
782 assert(isAddrLabelDiff() && "Invalid accessor");
783 return ((const AddrLabelDiffData *)(const char *)&Data)->RHSExpr;
784 }
785
787 assert(isReflection() && "Invalid accessor");
788 return ((const ReflectionData *)(const char *)&Data)->OperandKind;
789 }
790
791 const void *getReflectionOpaqueOperand() const {
792 assert(isReflection() && "Invalid accessor");
793 return ((const ReflectionData *)(const char *)&Data)->Operand;
794 }
795
796 void setInt(APSInt I) {
797 assert(isInt() && "Invalid accessor");
798 *(APSInt *)(char *)&Data = std::move(I);
799 }
800 void setFloat(APFloat F) {
801 assert(isFloat() && "Invalid accessor");
802 *(APFloat *)(char *)&Data = std::move(F);
803 }
804 void setFixedPoint(APFixedPoint FX) {
805 assert(isFixedPoint() && "Invalid accessor");
806 *(APFixedPoint *)(char *)&Data = std::move(FX);
807 }
808 void setVector(const APValue *E, unsigned N) {
809 MutableArrayRef<APValue> InternalElts = setVectorUninit(N);
810 for (unsigned i = 0; i != N; ++i)
811 InternalElts[i] = E[i];
812 }
813 void setMatrix(const APValue *E, unsigned NumRows, unsigned NumCols) {
814 MutableArrayRef<APValue> InternalElts = setMatrixUninit(NumRows, NumCols);
815 for (unsigned i = 0; i != NumRows * NumCols; ++i)
816 InternalElts[i] = E[i];
817 }
818 void setComplexInt(APSInt R, APSInt I) {
819 assert(R.getBitWidth() == I.getBitWidth() &&
820 "Invalid complex int (type mismatch).");
821 assert(isComplexInt() && "Invalid accessor");
822 ((ComplexAPSInt *)(char *)&Data)->Real = std::move(R);
823 ((ComplexAPSInt *)(char *)&Data)->Imag = std::move(I);
824 }
825 void setComplexFloat(APFloat R, APFloat I) {
826 assert(&R.getSemantics() == &I.getSemantics() &&
827 "Invalid complex float (type mismatch).");
828 assert(isComplexFloat() && "Invalid accessor");
829 ((ComplexAPFloat *)(char *)&Data)->Real = std::move(R);
830 ((ComplexAPFloat *)(char *)&Data)->Imag = std::move(I);
831 }
832 void setLValue(LValueBase B, CharUnits O, NoLValuePath, bool IsNullPtr);
833 void setLValue(LValueBase B, CharUnits O, ArrayRef<LValuePathEntry> Path,
834 bool OnePastTheEnd, bool IsNullPtr);
835 void setUnion(const FieldDecl *Field, const APValue &Value);
836 void setAddrLabelDiff(const AddrLabelExpr* LHSExpr,
837 const AddrLabelExpr* RHSExpr) {
838 ((AddrLabelDiffData *)(char *)&Data)->LHSExpr = LHSExpr;
839 ((AddrLabelDiffData *)(char *)&Data)->RHSExpr = RHSExpr;
840 }
841
842private:
843 void DestroyDataAndMakeUninit();
844 void MakeReflection(ReflectionKind OperandKind, const void *Operand) {
845 assert(isAbsent() && "Bad state change");
846 new ((void *)(char *)Data.buffer) ReflectionData{OperandKind, Operand};
847 Kind = Reflection;
848 }
849 void MakeInt(const APSInt &I) {
850 assert(isAbsent() && "Bad state change");
851 new ((void *)&Data) APSInt(std::move(I));
852 Kind = Int;
853 }
854 void MakeInt(APSInt &&I) {
855 assert(isAbsent() && "Bad state change");
856 new ((void *)&Data) APSInt(std::move(I));
857 Kind = Int;
858 }
859 void MakeFloat(const APFloat &F) {
860 assert(isAbsent() && "Bad state change");
861 new ((void *)(char *)&Data) APFloat(F);
862 Kind = Float;
863 }
864 void MakeFloat(APFloat &&F) {
865 assert(isAbsent() && "Bad state change");
866 new ((void *)(char *)&Data) APFloat(std::move(F));
867 Kind = Float;
868 }
869 void MakeFixedPoint(APFixedPoint &&FX) {
870 assert(isAbsent() && "Bad state change");
871 new ((void *)(char *)&Data) APFixedPoint(std::move(FX));
872 Kind = FixedPoint;
873 }
874 void MakeVector() {
875 assert(isAbsent() && "Bad state change");
876 new ((void *)(char *)&Data) Vec();
877 Kind = Vector;
878 }
879 void MakeMatrix() {
880 assert(isAbsent() && "Bad state change");
881 new ((void *)(char *)&Data) Mat();
882 Kind = Matrix;
883 }
884 void MakeComplexInt() {
885 assert(isAbsent() && "Bad state change");
886 new ((void *)(char *)&Data) ComplexAPSInt();
887 Kind = ComplexInt;
888 }
889 void MakeComplexFloat() {
890 assert(isAbsent() && "Bad state change");
891 new ((void *)(char *)&Data) ComplexAPFloat();
892 Kind = ComplexFloat;
893 }
894 void MakeLValue();
895 void MakeArray(unsigned InitElts, unsigned Size);
896 void MakeStruct(unsigned B, unsigned M, unsigned V) {
897 assert(isAbsent() && "Bad state change");
898 new ((void *)(char *)&Data) StructData(B, M, V);
899 Kind = Struct;
900 }
901 void MakeUnion() {
902 assert(isAbsent() && "Bad state change");
903 new ((void *)(char *)&Data) UnionData();
904 Kind = Union;
905 }
906 void MakeMemberPointer(const ValueDecl *Member, bool IsDerivedMember,
907 ArrayRef<const CXXRecordDecl*> Path);
908 void MakeAddrLabelDiff() {
909 assert(isAbsent() && "Bad state change");
910 new ((void *)(char *)&Data) AddrLabelDiffData();
912 }
913
914private:
915 /// The following functions are used as part of initialization, during
916 /// deserialization and importing. Reserve the space so that it can be
917 /// filled in by those steps.
918 MutableArrayRef<APValue> setVectorUninit(unsigned N) {
919 assert(isVector() && "Invalid accessor");
920 Vec *V = ((Vec *)(char *)&Data);
921 V->Elts = new APValue[N];
922 V->NumElts = N;
923 return {V->Elts, V->NumElts};
924 }
925 MutableArrayRef<APValue> setMatrixUninit(unsigned NumRows, unsigned NumCols) {
926 assert(isMatrix() && "Invalid accessor");
927 Mat *M = ((Mat *)(char *)&Data);
928 unsigned NumElts = NumRows * NumCols;
929 M->Elts = new APValue[NumElts];
930 M->NumRows = NumRows;
931 M->NumCols = NumCols;
932 return {M->Elts, NumElts};
933 }
934 MutableArrayRef<LValuePathEntry> setLValueUninit(LValueBase B, CharUnits O,
935 unsigned Size,
936 bool OnePastTheEnd,
937 bool IsNullPtr);
938 MutableArrayRef<const CXXRecordDecl *>
939 setMemberPointerUninit(const ValueDecl *Member, bool IsDerivedMember,
940 unsigned Size);
941};
942
943} // end namespace clang.
944
945namespace llvm {
946template<> struct DenseMapInfo<clang::APValue::LValueBase> {
947 static unsigned getHashValue(const clang::APValue::LValueBase &Base);
948 static bool isEqual(const clang::APValue::LValueBase &LHS,
949 const clang::APValue::LValueBase &RHS);
950};
951}
952
953#endif
#define V(N, I)
llvm::APSInt APSInt
Definition Compiler.cpp:26
static void dump(llvm::raw_ostream &OS, StringRef FunctionName, ArrayRef< CounterExpression > Expressions, ArrayRef< CounterMappingRegion > Regions)
TokenType getType() const
Returns the token's type, e.g.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
static bool isVector(QualType QT, QualType ElementType)
This helper function returns true if QT is a vector type that has element type ElementType.
friend llvm::hash_code hash_value(const LValueBase &Base)
Definition APValue.cpp:248
friend bool operator!=(const LValueBase &LHS, const LValueBase &RHS)
Definition APValue.h:220
void * DynamicAllocType
The QualType, if this is a DynamicAllocLValue.
Definition APValue.h:236
void * TypeInfoType
The type std::type_info, if this is a TypeInfoLValue.
Definition APValue.h:234
A non-discriminated union of a base, field, or array index.
Definition APValue.h:245
BaseOrMemberType getAsBaseOrMember() const
Definition APValue.h:259
uint64_t getAsArrayIndex() const
Definition APValue.h:263
friend llvm::hash_code hash_value(LValuePathEntry A)
Definition APValue.h:273
friend bool operator!=(LValuePathEntry A, LValuePathEntry B)
Definition APValue.h:270
static LValuePathEntry ArrayIndex(uint64_t Index)
Definition APValue.h:253
friend bool operator==(LValuePathEntry A, LValuePathEntry B)
Definition APValue.h:267
ArrayRef< LValuePathEntry > Path
Definition APValue.h:281
LValuePathSerializationHelper(ArrayRef< LValuePathEntry >, QualType)
Definition APValue.cpp:217
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Definition APValue.h:158
const APSInt & getComplexIntReal() const
Definition APValue.h:611
bool hasArrayFiller() const
Definition APValue.h:703
APValue(APFloat F)
Creates a float APValue holding the given value.
Definition APValue.h:391
const APValue & getMatrixElt(unsigned Idx) const
Definition APValue.h:680
void setFloat(APFloat F)
Definition APValue.h:800
APValue & getArrayInitializedElt(unsigned I)
Definition APValue.h:695
const void * getReflectionOpaqueOperand() const
Definition APValue.h:791
APSInt & getInt()
Definition APValue.h:577
APValue(ReflectionKind OperandKind, const void *Operand)
Creates a new Reflection APValue.
Definition APValue.h:469
APValue & getStructField(unsigned i)
Definition APValue.h:740
bool isReflection() const
Definition APValue.h:562
APValue(const APValue *E, unsigned NumRows, unsigned NumCols)
Creates a matrix APValue with given dimensions.
Definition APValue.h:406
void setInt(APSInt I)
Definition APValue.h:796
unsigned getMatrixNumColumns() const
Definition APValue.h:668
APValue(APSInt I)
Creates an integer APValue holding the given value.
Definition APValue.h:387
const FieldDecl * getUnionField() const
Definition APValue.h:761
const APFloat & getFloat() const
Definition APValue.h:595
bool isVector() const
Definition APValue.h:555
APSInt & getComplexIntImag()
Definition APValue.h:615
unsigned getStructNumFields() const
Definition APValue.h:727
const APValue & getArrayInitializedElt(unsigned I) const
Definition APValue.h:700
APValue(APFloat R, APFloat I)
Creates a float complex APValue with the given real and imaginary values.
Definition APValue.h:417
void setConstexprUnknown(bool IsConstexprUnknown=true)
Definition APValue.h:380
bool isAbsent() const
Definition APValue.h:545
APValue(const FieldDecl *ActiveDecl, const APValue &ActiveValue=APValue())
Creates a new union APValue.
Definition APValue.h:486
bool isComplexInt() const
Definition APValue.h:552
llvm::PointerIntPair< const Decl *, 1, bool > BaseOrMemberType
A FieldDecl or CXXRecordDecl, along with a flag indicating whether we mean a virtual or non-virtual b...
Definition APValue.h:242
ValueKind getKind() const
Definition APValue.h:537
ReflectionKind getReflectionOperandKind() const
Definition APValue.h:786
APValue & getStructVirtualBase(unsigned i)
Definition APValue.h:745
const APValue & getMatrixElt(unsigned Row, unsigned Col) const
Definition APValue.h:691
APValue(LValueBase Base, CharUnits Offset, ArrayRef< LValuePathEntry > Path, bool OnePastTheEnd, bool IsNullPtr=false)
Creates an lvalue APValue with an lvalue path.
Definition APValue.h:439
bool isArray() const
Definition APValue.h:557
APValue(const APValue *E, unsigned N)
Creates a vector APValue with N elements.
Definition APValue.h:400
void setFixedPoint(APFixedPoint FX)
Definition APValue.h:804
unsigned getArrayInitializedElts() const
Definition APValue.h:714
static APValue IndeterminateValue()
Definition APValue.h:508
bool isFloat() const
Definition APValue.h:550
void setLValue(LValueBase B, CharUnits O, NoLValuePath, bool IsNullPtr)
Definition APValue.cpp:1178
void setComplexInt(APSInt R, APSInt I)
Definition APValue.h:818
const APFixedPoint & getFixedPoint() const
Definition APValue.h:603
void Profile(llvm::FoldingSetNodeID &ID) const
profile this value.
Definition APValue.cpp:585
unsigned getStructNumBases() const
Definition APValue.h:723
APFixedPoint & getFixedPoint()
Definition APValue.h:599
APValue(const ValueDecl *Member, bool IsDerivedMember, ArrayRef< const CXXRecordDecl * > Path)
Creates a new member pointer APValue.
Definition APValue.h:496
const APValue & getStructBase(unsigned i) const
Definition APValue.h:751
bool hasValue() const
Definition APValue.h:547
friend class ASTNodeImporter
Definition APValue.h:293
unsigned getStructNumVirtualBases() const
Definition APValue.h:731
APValue & getUnionValue()
Definition APValue.h:765
void setMatrix(const APValue *E, unsigned NumRows, unsigned NumCols)
Definition APValue.h:813
const AddrLabelExpr * getAddrLabelDiffRHS() const
Definition APValue.h:781
CharUnits & getLValueOffset()
Definition APValue.cpp:1147
void setAddrLabelDiff(const AddrLabelExpr *LHSExpr, const AddrLabelExpr *RHSExpr)
Definition APValue.h:836
void setComplexFloat(APFloat R, APFloat I)
Definition APValue.h:825
APValue(LValueBase Base, CharUnits Offset, ConstexprUnknown, bool IsNullPtr=false)
Creates a constexpr unknown lvalue APValue.
Definition APValue.h:449
bool isComplexFloat() const
Definition APValue.h:553
APValue & getVectorElt(unsigned I)
Definition APValue.h:651
APValue & getArrayFiller()
Definition APValue.h:706
const APValue & getArrayFiller() const
Definition APValue.h:711
const APFloat & getComplexFloatImag() const
Definition APValue.h:635
unsigned getVectorLength() const
Definition APValue.h:659
const APValue & getUnionValue() const
Definition APValue.h:769
const APValue & getVectorElt(unsigned I) const
Definition APValue.h:656
APValue(UninitArray, unsigned InitElts, unsigned Size)
Creates a new array APValue.
Definition APValue.h:461
APValue(LValueBase Base, CharUnits Offset, NoLValuePath, bool IsNullPtr=false)
Creates an lvalue APValue without an lvalue path.
Definition APValue.h:426
bool isLValue() const
Definition APValue.h:554
CharUnits getLValueOffset() const
Definition APValue.h:641
void setUnion(const FieldDecl *Field, const APValue &Value)
Definition APValue.cpp:1213
APValue(const AddrLabelExpr *LHSExpr, const AddrLabelExpr *RHSExpr)
Creates a new address label diff APValue.
Definition APValue.h:504
bool isIndeterminate() const
Definition APValue.h:546
unsigned getMatrixNumRows() const
Definition APValue.h:664
bool isMemberPointer() const
Definition APValue.h:560
const APSInt & getInt() const
Definition APValue.h:581
friend class ASTImporter
Definition APValue.h:292
APValue & getMatrixElt(unsigned Row, unsigned Col)
Definition APValue.h:683
const APFloat & getComplexFloatReal() const
Definition APValue.h:627
bool isInt() const
Definition APValue.h:549
unsigned getArraySize() const
Definition APValue.h:718
APValue(APSInt R, APSInt I)
Creates an integer complex APValue with the given real and imaginary values.
Definition APValue.h:413
APValue(UninitStruct, unsigned NumBases, unsigned NumMembers, unsigned NumVirtualBases=0)
Creates a new struct APValue.
Definition APValue.h:478
bool isUnion() const
Definition APValue.h:559
bool allowConstexprUnknown() const
Definition APValue.h:378
bool isFixedPoint() const
Definition APValue.h:551
void setVector(const APValue *E, unsigned N)
Definition APValue.h:808
APValue & getMatrixElt(unsigned Idx)
Definition APValue.h:675
@ Indeterminate
This object has an indeterminate value (C++ [basic.indet]).
Definition APValue.h:167
@ None
There is no such object (it's outside its lifetime).
Definition APValue.h:165
const APValue & getStructVirtualBase(unsigned i) const
Definition APValue.h:757
const APValue & getStructField(unsigned i) const
Definition APValue.h:754
const APSInt & getComplexIntImag() const
Definition APValue.h:619
bool isStruct() const
Definition APValue.h:558
APSInt & getComplexIntReal()
Definition APValue.h:607
APFloat & getComplexFloatImag()
Definition APValue.h:631
APFloat & getComplexFloatReal()
Definition APValue.h:623
APFloat & getFloat()
Definition APValue.h:591
APValue & getStructBase(unsigned i)
Definition APValue.h:735
bool isMatrix() const
Definition APValue.h:556
APValue(APFixedPoint FX)
Creates a fixed-point APValue holding the given value.
Definition APValue.h:395
const AddrLabelExpr * getAddrLabelDiffLHS() const
Definition APValue.h:777
unsigned getMatrixNumElements() const
Definition APValue.h:672
bool isAddrLabelDiff() const
Definition APValue.h:561
APValue()
Creates an empty APValue of type None.
Definition APValue.h:385
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition ASTContext.h:246
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition Expr.h:4619
Represents a C++ struct/union/class.
Definition DeclCXX.h:258
This is an opaque type for sizes expressed in character units.
Definition CharUnits.h:38
Decl - This represents one declaration (or definition), e.g.
Definition DeclBase.h:86
A little helper class used to produce diagnostics.
Symbolic representation of a dynamic allocation.
Definition APValue.h:79
DynamicAllocLValue(unsigned Idx, DynAllocKind AllocKind)
Definition APValue.h:96
static constexpr int NumAllocKindBits
Definition APValue.h:82
const void * getOpaqueValue() const
Definition APValue.h:107
static constexpr int NumLowBitsAvailable
Definition APValue.h:81
static uintptr_t getMaxIndex()
Definition APValue.h:120
unsigned getIndex() const
Definition APValue.h:100
DynAllocKind getAllocKind() const
Definition APValue.h:101
static DynamicAllocLValue getFromOpaqueValue(const void *Value)
Definition APValue.h:111
This represents one expression.
Definition Expr.h:114
Represents a member of a struct/union/class.
Definition Decl.h:3341
A (possibly-)qualified type.
Definition TypeBase.h:938
Symbolic representation of typeid(T) for some type T.
Definition APValue.h:48
const Type * getType() const
Definition APValue.h:55
static TypeInfoLValue getFromOpaqueValue(const void *Value)
Definition APValue.h:59
void print(llvm::raw_ostream &Out, const PrintingPolicy &Policy) const
Definition APValue.cpp:90
const void * getOpaqueValue() const
Definition APValue.h:58
The base class of the type hierarchy.
Definition TypeBase.h:1879
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition Decl.h:714
#define CHAR_BIT
Definition limits.h:71
llvm::APFloat APFloat
Definition Floating.h:27
@ AddrLabelDiff
Difference between two AddrLabelExpr.
Definition Primitives.h:38
Top level wrappers for InstallAPI frontend operations.
bool isa(CodeGen::Address addr)
Definition Address.h:330
DynAllocKind
Kind of source for a dynamic allocation.
Definition APValue.h:69
bool operator==(const CallGraphNode::CallRecord &LHS, const CallGraphNode::CallRecord &RHS)
Definition CallGraph.h:218
ReflectionKind
Definition Reflection.h:22
@ Result
The result type of a method or function.
Definition TypeBase.h:906
llvm::StringRef getAsString(SyncScope S)
Definition SyncScope.h:63
U cast(CodeGen::Address addr)
Definition Address.h:327
Diagnostic wrappers for TextAPI types for error reporting.
Definition Dominators.h:30
hash_code hash_value(const clang::dependencies::ModuleID &ID)
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
__builtin_elementwise_add_sat __builtin_elementwise_sub_sat uint32_t uint64_t __builtin_riscv_ssha_i32 __builtin_riscv_sshl_u32 uint64_t
#define false
Definition stdbool.h:26
#define true
Definition stdbool.h:25
Describes how types, statements, expressions, and declarations should be printed.
static bool isEqual(const clang::APValue::LValueBase &LHS, const clang::APValue::LValueBase &RHS)
Definition APValue.cpp:261
static unsigned getHashValue(const clang::APValue::LValueBase &Base)
Definition APValue.cpp:256
static const void * getAsVoidPointer(clang::DynamicAllocLValue V)
Definition APValue.h:143
static clang::DynamicAllocLValue getFromVoidPointer(const void *P)
Definition APValue.h:146
static clang::TypeInfoLValue getFromVoidPointer(const void *P)
Definition APValue.h:134
static const void * getAsVoidPointer(clang::TypeInfoLValue V)
Definition APValue.h:131