clang  3.9.0
VTableBuilder.h
Go to the documentation of this file.
1 //===--- VTableBuilder.h - C++ vtable layout builder --------------*- C++ -*-=//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This contains code dealing with generation of the layout of virtual tables.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CLANG_AST_VTABLEBUILDER_H
15 #define LLVM_CLANG_AST_VTABLEBUILDER_H
16 
19 #include "clang/AST/GlobalDecl.h"
20 #include "clang/AST/RecordLayout.h"
21 #include "clang/Basic/ABI.h"
22 #include "llvm/ADT/DenseMap.h"
23 #include "llvm/ADT/SetVector.h"
24 #include <memory>
25 #include <utility>
26 
27 namespace clang {
28  class CXXRecordDecl;
29 
30 /// \brief Represents a single component in a vtable.
32 public:
33  enum Kind {
39 
40  /// \brief A pointer to the complete destructor.
42 
43  /// \brief A pointer to the deleting destructor.
45 
46  /// \brief An entry that is never used.
47  ///
48  /// In some cases, a vtable function pointer will end up never being
49  /// called. Such vtable function pointers are represented as a
50  /// CK_UnusedFunctionPointer.
52  };
53 
54  VTableComponent() = default;
55 
57  return VTableComponent(CK_VCallOffset, Offset);
58  }
59 
61  return VTableComponent(CK_VBaseOffset, Offset);
62  }
63 
65  return VTableComponent(CK_OffsetToTop, Offset);
66  }
67 
69  return VTableComponent(CK_RTTI, reinterpret_cast<uintptr_t>(RD));
70  }
71 
73  assert(!isa<CXXDestructorDecl>(MD) &&
74  "Don't use MakeFunction with destructors!");
75 
77  reinterpret_cast<uintptr_t>(MD));
78  }
79 
82  reinterpret_cast<uintptr_t>(DD));
83  }
84 
87  reinterpret_cast<uintptr_t>(DD));
88  }
89 
91  assert(!isa<CXXDestructorDecl>(MD) &&
92  "Don't use MakeUnusedFunction with destructors!");
94  reinterpret_cast<uintptr_t>(MD));
95  }
96 
98  return VTableComponent(I);
99  }
100 
101  /// \brief Get the kind of this vtable component.
102  Kind getKind() const {
103  return (Kind)(Value & 0x7);
104  }
105 
107  assert(getKind() == CK_VCallOffset && "Invalid component kind!");
108 
109  return getOffset();
110  }
111 
113  assert(getKind() == CK_VBaseOffset && "Invalid component kind!");
114 
115  return getOffset();
116  }
117 
119  assert(getKind() == CK_OffsetToTop && "Invalid component kind!");
120 
121  return getOffset();
122  }
123 
124  const CXXRecordDecl *getRTTIDecl() const {
125  assert(isRTTIKind() && "Invalid component kind!");
126  return reinterpret_cast<CXXRecordDecl *>(getPointer());
127  }
128 
130  assert(isFunctionPointerKind() && "Invalid component kind!");
131  if (isDestructorKind())
132  return getDestructorDecl();
133  return reinterpret_cast<CXXMethodDecl *>(getPointer());
134  }
135 
137  assert(isDestructorKind() && "Invalid component kind!");
138  return reinterpret_cast<CXXDestructorDecl *>(getPointer());
139  }
140 
142  assert(getKind() == CK_UnusedFunctionPointer && "Invalid component kind!");
143  return reinterpret_cast<CXXMethodDecl *>(getPointer());
144  }
145 
146  bool isDestructorKind() const { return isDestructorKind(getKind()); }
147 
150  }
151 
152  bool isFunctionPointerKind() const {
153  return isFunctionPointerKind(getKind());
154  }
155 
156  bool isRTTIKind() const { return isRTTIKind(getKind()); }
157 
158 private:
159  static bool isFunctionPointerKind(Kind ComponentKind) {
160  return isUsedFunctionPointerKind(ComponentKind) ||
161  ComponentKind == CK_UnusedFunctionPointer;
162  }
163  static bool isUsedFunctionPointerKind(Kind ComponentKind) {
164  return ComponentKind == CK_FunctionPointer ||
165  isDestructorKind(ComponentKind);
166  }
167  static bool isDestructorKind(Kind ComponentKind) {
168  return ComponentKind == CK_CompleteDtorPointer ||
169  ComponentKind == CK_DeletingDtorPointer;
170  }
171  static bool isRTTIKind(Kind ComponentKind) {
172  return ComponentKind == CK_RTTI;
173  }
174 
175  VTableComponent(Kind ComponentKind, CharUnits Offset) {
176  assert((ComponentKind == CK_VCallOffset ||
177  ComponentKind == CK_VBaseOffset ||
178  ComponentKind == CK_OffsetToTop) && "Invalid component kind!");
179  assert(Offset.getQuantity() < (1LL << 56) && "Offset is too big!");
180  assert(Offset.getQuantity() >= -(1LL << 56) && "Offset is too small!");
181 
182  Value = (uint64_t(Offset.getQuantity()) << 3) | ComponentKind;
183  }
184 
185  VTableComponent(Kind ComponentKind, uintptr_t Ptr) {
186  assert((isRTTIKind(ComponentKind) || isFunctionPointerKind(ComponentKind)) &&
187  "Invalid component kind!");
188 
189  assert((Ptr & 7) == 0 && "Pointer not sufficiently aligned!");
190 
191  Value = Ptr | ComponentKind;
192  }
193 
194  CharUnits getOffset() const {
195  assert((getKind() == CK_VCallOffset || getKind() == CK_VBaseOffset ||
196  getKind() == CK_OffsetToTop) && "Invalid component kind!");
197 
198  return CharUnits::fromQuantity(Value >> 3);
199  }
200 
201  uintptr_t getPointer() const {
202  assert((getKind() == CK_RTTI || isFunctionPointerKind()) &&
203  "Invalid component kind!");
204 
205  return static_cast<uintptr_t>(Value & ~7ULL);
206  }
207 
208  explicit VTableComponent(uint64_t Value)
209  : Value(Value) { }
210 
211  /// The kind is stored in the lower 3 bits of the value. For offsets, we
212  /// make use of the facts that classes can't be larger than 2^55 bytes,
213  /// so we store the offset in the lower part of the 61 bits that remain.
214  /// (The reason that we're not simply using a PointerIntPair here is that we
215  /// need the offsets to be 64-bit, even when on a 32-bit machine).
216  int64_t Value;
217 };
218 
220 public:
221  typedef std::pair<uint64_t, ThunkInfo> VTableThunkTy;
222 
225  typedef llvm::iterator_range<vtable_component_iterator>
227 
228  typedef llvm::DenseMap<BaseSubobject, uint64_t> AddressPointsMapTy;
229 
230 private:
231  uint64_t NumVTableComponents;
232  std::unique_ptr<VTableComponent[]> VTableComponents;
233 
234  /// \brief Contains thunks needed by vtables, sorted by indices.
235  uint64_t NumVTableThunks;
236  std::unique_ptr<VTableThunkTy[]> VTableThunks;
237 
238  /// \brief Address points for all vtables.
239  AddressPointsMapTy AddressPoints;
240 
241  bool IsMicrosoftABI;
242 
243 public:
244  VTableLayout(uint64_t NumVTableComponents,
245  const VTableComponent *VTableComponents,
246  uint64_t NumVTableThunks,
247  const VTableThunkTy *VTableThunks,
248  const AddressPointsMapTy &AddressPoints,
249  bool IsMicrosoftABI);
250  ~VTableLayout();
251 
252  uint64_t getNumVTableComponents() const {
253  return NumVTableComponents;
254  }
255 
259  }
260 
262  return VTableComponents.get();
263  }
264 
266  return VTableComponents.get() + NumVTableComponents;
267  }
268 
269  uint64_t getNumVTableThunks() const { return NumVTableThunks; }
270 
272  return VTableThunks.get();
273  }
274 
276  return VTableThunks.get() + NumVTableThunks;
277  }
278 
280  assert(AddressPoints.count(Base) &&
281  "Did not find address point!");
282 
283  uint64_t AddressPoint = AddressPoints.lookup(Base);
284  assert(AddressPoint != 0 || IsMicrosoftABI);
285  (void)IsMicrosoftABI;
286 
287  return AddressPoint;
288  }
289 
291  return AddressPoints;
292  }
293 };
294 
296 public:
298 
299  bool isMicrosoft() const { return IsMicrosoftABI; }
300 
301  virtual ~VTableContextBase() {}
302 
303 protected:
304  typedef llvm::DenseMap<const CXXMethodDecl *, ThunkInfoVectorTy> ThunksMapTy;
305 
306  /// \brief Contains all thunks that a given method decl will need.
308 
309  /// Compute and store all vtable related information (vtable layout, vbase
310  /// offset offsets, thunks etc) for the given record decl.
311  virtual void computeVTableRelatedInformation(const CXXRecordDecl *RD) = 0;
312 
314 
315 public:
317  const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl()->getCanonicalDecl());
319 
320  // This assumes that all the destructors present in the vtable
321  // use exactly the same set of thunks.
322  ThunksMapTy::const_iterator I = Thunks.find(MD);
323  if (I == Thunks.end()) {
324  // We did not find a thunk for this method.
325  return nullptr;
326  }
327 
328  return &I->second;
329  }
330 
332 };
333 
335 private:
336 
337  /// \brief Contains the index (relative to the vtable address point)
338  /// where the function pointer for a virtual function is stored.
339  typedef llvm::DenseMap<GlobalDecl, int64_t> MethodVTableIndicesTy;
340  MethodVTableIndicesTy MethodVTableIndices;
341 
342  typedef llvm::DenseMap<const CXXRecordDecl *, const VTableLayout *>
343  VTableLayoutMapTy;
344  VTableLayoutMapTy VTableLayouts;
345 
346  typedef std::pair<const CXXRecordDecl *,
347  const CXXRecordDecl *> ClassPairTy;
348 
349  /// \brief vtable offsets for offsets of virtual bases of a class.
350  ///
351  /// Contains the vtable offset (relative to the address point) in chars
352  /// where the offsets for virtual bases of a class are stored.
353  typedef llvm::DenseMap<ClassPairTy, CharUnits>
354  VirtualBaseClassOffsetOffsetsMapTy;
355  VirtualBaseClassOffsetOffsetsMapTy VirtualBaseClassOffsetOffsets;
356 
357  void computeVTableRelatedInformation(const CXXRecordDecl *RD) override;
358 
359 public:
361  ~ItaniumVTableContext() override;
362 
364  computeVTableRelatedInformation(RD);
365  assert(VTableLayouts.count(RD) && "No layout for this record decl!");
366 
367  return *VTableLayouts[RD];
368  }
369 
370  VTableLayout *
371  createConstructionVTableLayout(const CXXRecordDecl *MostDerivedClass,
372  CharUnits MostDerivedClassOffset,
373  bool MostDerivedClassIsVirtual,
374  const CXXRecordDecl *LayoutClass);
375 
376  /// \brief Locate a virtual function in the vtable.
377  ///
378  /// Return the index (relative to the vtable address point) where the
379  /// function pointer for the given virtual function is stored.
380  uint64_t getMethodVTableIndex(GlobalDecl GD);
381 
382  /// Return the offset in chars (relative to the vtable address point) where
383  /// the offset of the virtual base that contains the given base is stored,
384  /// otherwise, if no virtual base contains the given class, return 0.
385  ///
386  /// Base must be a virtual base class or an unambiguous base.
388  const CXXRecordDecl *VBase);
389 
390  static bool classof(const VTableContextBase *VT) {
391  return !VT->isMicrosoft();
392  }
393 };
394 
395 /// Holds information about the inheritance path to a virtual base or function
396 /// table pointer. A record may contain as many vfptrs or vbptrs as there are
397 /// base subobjects.
398 struct VPtrInfo {
400 
402  : ReusingBase(RD), BaseWithVPtr(RD), NextBaseToMangle(RD) {}
403 
404  /// The vtable will hold all of the virtual bases or virtual methods of
405  /// ReusingBase. This may or may not be the same class as VPtrSubobject.Base.
406  /// A derived class will reuse the vptr of the first non-virtual base
407  /// subobject that has one.
409 
410  /// BaseWithVPtr is at this offset from its containing complete object or
411  /// virtual base.
413 
414  /// The vptr is stored inside this subobject.
416 
417  /// The bases from the inheritance path that got used to mangle the vbtable
418  /// name. This is not really a full path like a CXXBasePath. It holds the
419  /// subset of records that need to be mangled into the vbtable symbol name in
420  /// order to get a unique name.
422 
423  /// The next base to push onto the mangled path if this path is ambiguous in a
424  /// derived class. If it's null, then it's already been pushed onto the path.
426 
427  /// The set of possibly indirect vbases that contain this vbtable. When a
428  /// derived class indirectly inherits from the same vbase twice, we only keep
429  /// vtables and their paths from the first instance.
431 
432  /// This holds the base classes path from the complete type to the first base
433  /// with the given vfptr offset, in the base-to-derived order. Only used for
434  /// vftables.
436 
437  /// Static offset from the top of the most derived class to this vfptr,
438  /// including any virtual base offset. Only used for vftables.
440 
441  /// The vptr is stored inside the non-virtual component of this virtual base.
443  return ContainingVBases.empty() ? nullptr : ContainingVBases.front();
444  }
445 };
446 
448 
449 /// All virtual base related information about a given record decl. Includes
450 /// information on all virtual base tables and the path components that are used
451 /// to mangle them.
453  ~VirtualBaseInfo() { llvm::DeleteContainerPointers(VBPtrPaths); }
454 
455  /// A map from virtual base to vbtable index for doing a conversion from the
456  /// the derived class to the a base.
457  llvm::DenseMap<const CXXRecordDecl *, unsigned> VBTableIndices;
458 
459  /// Information on all virtual base tables used when this record is the most
460  /// derived class.
462 };
463 
465 public:
467  /// If nonzero, holds the vbtable index of the virtual base with the vfptr.
468  uint64_t VBTableIndex;
469 
470  /// If nonnull, holds the last vbase which contains the vfptr that the
471  /// method definition is adjusted to.
473 
474  /// This is the offset of the vfptr from the start of the last vbase, or the
475  /// complete type if there are no virtual bases.
477 
478  /// Method's index in the vftable.
479  uint64_t Index;
480 
482  : VBTableIndex(0), VBase(nullptr), VFPtrOffset(CharUnits::Zero()),
483  Index(0) {}
484 
486  CharUnits VFPtrOffset, uint64_t Index)
487  : VBTableIndex(VBTableIndex), VBase(VBase),
488  VFPtrOffset(VFPtrOffset), Index(Index) {}
489 
490  bool operator<(const MethodVFTableLocation &other) const {
491  if (VBTableIndex != other.VBTableIndex) {
492  assert(VBase != other.VBase);
493  return VBTableIndex < other.VBTableIndex;
494  }
495  return std::tie(VFPtrOffset, Index) <
496  std::tie(other.VFPtrOffset, other.Index);
497  }
498  };
499 
500 private:
501  ASTContext &Context;
502 
503  typedef llvm::DenseMap<GlobalDecl, MethodVFTableLocation>
504  MethodVFTableLocationsTy;
505  MethodVFTableLocationsTy MethodVFTableLocations;
506 
507  typedef llvm::DenseMap<const CXXRecordDecl *, VPtrInfoVector *>
508  VFPtrLocationsMapTy;
509  VFPtrLocationsMapTy VFPtrLocations;
510 
511  typedef std::pair<const CXXRecordDecl *, CharUnits> VFTableIdTy;
512  typedef llvm::DenseMap<VFTableIdTy, const VTableLayout *> VFTableLayoutMapTy;
513  VFTableLayoutMapTy VFTableLayouts;
514 
515  llvm::DenseMap<const CXXRecordDecl *, VirtualBaseInfo *> VBaseInfo;
516 
517  void enumerateVFPtrs(const CXXRecordDecl *ForClass, VPtrInfoVector &Result);
518 
519  void computeVTableRelatedInformation(const CXXRecordDecl *RD) override;
520 
521  void dumpMethodLocations(const CXXRecordDecl *RD,
522  const MethodVFTableLocationsTy &NewMethods,
523  raw_ostream &);
524 
525  const VirtualBaseInfo *
526  computeVBTableRelatedInformation(const CXXRecordDecl *RD);
527 
528  void computeVTablePaths(bool ForVBTables, const CXXRecordDecl *RD,
529  VPtrInfoVector &Paths);
530 
531 public:
533  : VTableContextBase(/*MS=*/true), Context(Context) {}
534 
535  ~MicrosoftVTableContext() override;
536 
537  const VPtrInfoVector &getVFPtrOffsets(const CXXRecordDecl *RD);
538 
540  CharUnits VFPtrOffset);
541 
542  const MethodVFTableLocation &getMethodVFTableLocation(GlobalDecl GD);
543 
545  // Complete destructors don't have a slot in a vftable, so no thunks needed.
546  if (isa<CXXDestructorDecl>(GD.getDecl()) &&
547  GD.getDtorType() == Dtor_Complete)
548  return nullptr;
550  }
551 
552  /// \brief Returns the index of VBase in the vbtable of Derived.
553  /// VBase must be a morally virtual base of Derived.
554  /// The vbtable is an array of i32 offsets. The first entry is a self entry,
555  /// and the rest are offsets from the vbptr to virtual bases.
556  unsigned getVBTableIndex(const CXXRecordDecl *Derived,
557  const CXXRecordDecl *VBase);
558 
560 
561  static bool classof(const VTableContextBase *VT) { return VT->isMicrosoft(); }
562 };
563 
564 } // namespace clang
565 
566 #endif
CharUnits getOffsetToTop() const
VTableLayout * createConstructionVTableLayout(const CXXRecordDecl *MostDerivedClass, CharUnits MostDerivedClassOffset, bool MostDerivedClassIsVirtual, const CXXRecordDecl *LayoutClass)
ItaniumVTableContext(ASTContext &Context)
static VTableComponent MakeRTTI(const CXXRecordDecl *RD)
Definition: VTableBuilder.h:68
VPtrInfoVector VBPtrPaths
Information on all virtual base tables used when this record is the most derived class.
virtual const ThunkInfoVectorTy * getThunkInfo(GlobalDecl GD)
vtable_component_iterator vtable_component_begin() const
const VTableThunkTy * vtable_thunk_iterator
vtable_component_iterator vtable_component_end() const
BasePath MangledPath
The bases from the inheritance path that got used to mangle the vbtable name.
static VTableComponent MakeUnusedFunction(const CXXMethodDecl *MD)
Definition: VTableBuilder.h:90
static VTableComponent getFromOpaqueInteger(uint64_t I)
Definition: VTableBuilder.h:97
static VTableComponent MakeVCallOffset(CharUnits Offset)
Definition: VTableBuilder.h:56
const CXXRecordDecl * getVBaseWithVPtr() const
The vptr is stored inside the non-virtual component of this virtual base.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:92
BasePath PathToBaseWithVPtr
This holds the base classes path from the complete type to the first base with the given vfptr offset...
uint64_t getNumVTableComponents() const
VTableLayout(uint64_t NumVTableComponents, const VTableComponent *VTableComponents, uint64_t NumVTableThunks, const VTableThunkTy *VTableThunks, const AddressPointsMapTy &AddressPoints, bool IsMicrosoftABI)
static VTableComponent MakeCompleteDtor(const CXXDestructorDecl *DD)
Definition: VTableBuilder.h:80
llvm::DenseMap< const CXXRecordDecl *, unsigned > VBTableIndices
A map from virtual base to vbtable index for doing a conversion from the the derived class to the a b...
const VTableComponent * vtable_component_iterator
const Decl * getDecl() const
Definition: GlobalDecl.h:62
const CXXRecordDecl * NextBaseToMangle
The next base to push onto the mangled path if this path is ambiguous in a derived class...
uint64_t getAddressPoint(BaseSubobject Base) const
const CXXMethodDecl * getFunctionDecl() const
CharUnits - This is an opaque type for sizes expressed in character units.
Definition: CharUnits.h:38
bool isRTTIKind() const
llvm::DenseMap< const CXXMethodDecl *, ThunkInfoVectorTy > ThunksMapTy
uint32_t Offset
Definition: CacheTokens.cpp:44
CharUnits getVCallOffset() const
const CXXRecordDecl * getParent() const
Returns the parent of this method declaration, which is the class in which this method is defined...
Definition: DeclCXX.h:1838
CharUnits VFPtrOffset
This is the offset of the vfptr from the start of the last vbase, or the complete type if there are n...
const VPtrInfoVector & getVFPtrOffsets(const CXXRecordDecl *RD)
Enums/classes describing ABI related information about constructors, destructors and thunks...
uint64_t getMethodVTableIndex(GlobalDecl GD)
Locate a virtual function in the vtable.
detail::InMemoryDirectory::const_iterator I
CharUnits getVirtualBaseOffsetOffset(const CXXRecordDecl *RD, const CXXRecordDecl *VBase)
Return the offset in chars (relative to the vtable address point) where the offset of the virtual bas...
static VTableComponent MakeDeletingDtor(const CXXDestructorDecl *DD)
Definition: VTableBuilder.h:85
uint64_t VBTableIndex
If nonzero, holds the vbtable index of the virtual base with the vfptr.
BasePath ContainingVBases
The set of possibly indirect vbases that contain this vbtable.
const CXXRecordDecl * VBase
If nonnull, holds the last vbase which contains the vfptr that the method definition is adjusted to...
ASTContext * Context
CXXDtorType getDtorType() const
Definition: GlobalDecl.h:69
SmallVector< ThunkInfo, 1 > ThunkInfoVectorTy
static bool classof(const VTableContextBase *VT)
bool operator<(const MethodVFTableLocation &other) const
Represents a C++ destructor within a class.
Definition: DeclCXX.h:2414
static CharUnits fromQuantity(QuantityType Quantity)
fromQuantity - Construct a CharUnits quantity from a raw integer type.
Definition: CharUnits.h:63
vtable_thunk_iterator vtable_thunk_end() const
llvm::DenseMap< BaseSubobject, uint64_t > AddressPointsMapTy
MethodVFTableLocation(uint64_t VBTableIndex, const CXXRecordDecl *VBase, CharUnits VFPtrOffset, uint64_t Index)
SmallVector< VPtrInfo *, 2 > VPtrInfoVector
The result type of a method or function.
SmallVector< const CXXRecordDecl *, 1 > BasePath
const CXXRecordDecl * ReusingBase
The vtable will hold all of the virtual bases or virtual methods of ReusingBase.
const ThunkInfoVectorTy * getThunkInfo(GlobalDecl GD) override
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
Definition: opencl-c.h:75
GlobalDecl - represents a global declaration.
Definition: GlobalDecl.h:29
bool isUsedFunctionPointerKind() const
unsigned getVBTableIndex(const CXXRecordDecl *Derived, const CXXRecordDecl *VBase)
Returns the index of VBase in the vbtable of Derived.
const CXXRecordDecl * getRTTIDecl() const
uint64_t getNumVTableThunks() const
Kind
Represents a single component in a vtable.
Definition: VTableBuilder.h:31
Represents a static or instance method of a struct/union/class.
Definition: DeclCXX.h:1736
const VTableLayout & getVFTableLayout(const CXXRecordDecl *RD, CharUnits VFPtrOffset)
const CXXDestructorDecl * getDestructorDecl() const
const CXXRecordDecl * BaseWithVPtr
The vptr is stored inside this subobject.
Complete object dtor.
Definition: ABI.h:36
MicrosoftVTableContext(ASTContext &Context)
static VTableComponent MakeVBaseOffset(CharUnits Offset)
Definition: VTableBuilder.h:60
bool isFunctionPointerKind() const
const VPtrInfoVector & enumerateVBTables(const CXXRecordDecl *RD)
ThunksMapTy Thunks
Contains all thunks that a given method decl will need.
CharUnits getVBaseOffset() const
VPtrInfo(const CXXRecordDecl *RD)
CharUnits NonVirtualOffset
BaseWithVPtr is at this offset from its containing complete object or virtual base.
vtable_component_range vtable_components() const
All virtual base related information about a given record decl.
vtable_thunk_iterator vtable_thunk_begin() const
bool isDestructorKind() const
const VTableLayout & getVTableLayout(const CXXRecordDecl *RD)
Represents a C++ struct/union/class.
Definition: DeclCXX.h:263
llvm::iterator_range< vtable_component_iterator > vtable_component_range
std::pair< uint64_t, ThunkInfo > VTableThunkTy
CharUnits FullOffsetInMDC
Static offset from the top of the most derived class to this vfptr, including any virtual base offset...
uint64_t Index
Method's index in the vftable.
A pointer to the deleting destructor.
Definition: VTableBuilder.h:44
static VTableComponent MakeFunction(const CXXMethodDecl *MD)
Definition: VTableBuilder.h:72
Holds information about the inheritance path to a virtual base or function table pointer.
Kind getKind() const
Get the kind of this vtable component.
const AddressPointsMapTy & getAddressPoints() const
#define true
Definition: stdbool.h:32
const CXXMethodDecl * getUnusedFunctionDecl() const
A pointer to the complete destructor.
Definition: VTableBuilder.h:41
const MethodVFTableLocation & getMethodVFTableLocation(GlobalDecl GD)
virtual void computeVTableRelatedInformation(const CXXRecordDecl *RD)=0
Compute and store all vtable related information (vtable layout, vbase offset offsets, thunks etc) for the given record decl.
static bool classof(const VTableContextBase *VT)
static VTableComponent MakeOffsetToTop(CharUnits Offset)
Definition: VTableBuilder.h:64