diff options
Diffstat (limited to 'clang/include/clang/AST/CXXInheritance.h')
-rw-r--r-- | clang/include/clang/AST/CXXInheritance.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/include/clang/AST/CXXInheritance.h b/clang/include/clang/AST/CXXInheritance.h index bb2ad9c64d3..f223c1f2f4f 100644 --- a/clang/include/clang/AST/CXXInheritance.h +++ b/clang/include/clang/AST/CXXInheritance.h @@ -372,6 +372,30 @@ class CXXFinalOverriderMap class CXXIndirectPrimaryBaseSet : public llvm::SmallSet<const CXXRecordDecl*, 32> {}; +inline bool +inheritanceModelHasVBPtrOffsetField(MSInheritanceModel Inheritance) { + return Inheritance == MSInheritanceModel::Unspecified; +} + +// Only member pointers to functions need a this adjustment, since it can be +// combined with the field offset for data pointers. +inline bool inheritanceModelHasNVOffsetField(bool IsMemberFunction, + MSInheritanceModel Inheritance) { + return IsMemberFunction && Inheritance >= MSInheritanceModel::Multiple; +} + +inline bool +inheritanceModelHasVBTableOffsetField(MSInheritanceModel Inheritance) { + return Inheritance >= MSInheritanceModel::Virtual; +} + +inline bool inheritanceModelHasOnlyOneField(bool IsMemberFunction, + MSInheritanceModel Inheritance) { + if (IsMemberFunction) + return Inheritance <= MSInheritanceModel::Single; + return Inheritance <= MSInheritanceModel::Multiple; +} + } // namespace clang #endif // LLVM_CLANG_AST_CXXINHERITANCE_H |