diff options
Diffstat (limited to 'contrib/llvm/tools/clang/include/clang/AST/VTableBuilder.h')
-rw-r--r-- | contrib/llvm/tools/clang/include/clang/AST/VTableBuilder.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/contrib/llvm/tools/clang/include/clang/AST/VTableBuilder.h b/contrib/llvm/tools/clang/include/clang/AST/VTableBuilder.h index a6aa40b..bcbe875 100644 --- a/contrib/llvm/tools/clang/include/clang/AST/VTableBuilder.h +++ b/contrib/llvm/tools/clang/include/clang/AST/VTableBuilder.h @@ -215,12 +215,15 @@ private: /// Address points - Address points for all vtables. AddressPointsMapTy AddressPoints; + bool IsMicrosoftABI; + public: VTableLayout(uint64_t NumVTableComponents, const VTableComponent *VTableComponents, uint64_t NumVTableThunks, const VTableThunkTy *VTableThunks, - const AddressPointsMapTy &AddressPoints); + const AddressPointsMapTy &AddressPoints, + bool IsMicrosoftABI); ~VTableLayout(); uint64_t getNumVTableComponents() const { @@ -252,7 +255,8 @@ public: "Did not find address point!"); uint64_t AddressPoint = AddressPoints.lookup(Base); - assert(AddressPoint && "Address point must not be zero!"); + assert(AddressPoint != 0 || IsMicrosoftABI); + (void)IsMicrosoftABI; return AddressPoint; } @@ -271,6 +275,8 @@ public: typedef SmallVector<ThunkInfo, 1> ThunkInfoVectorTy; private: + bool IsMicrosoftABI; + /// MethodVTableIndices - Contains the index (relative to the vtable address /// point) where the function pointer for a virtual function is stored. typedef llvm::DenseMap<GlobalDecl, int64_t> MethodVTableIndicesTy; @@ -306,10 +312,21 @@ private: /// given record decl. void ComputeVTableRelatedInformation(const CXXRecordDecl *RD); + /// ErrorUnsupported - Print out an error that the v-table layout code + /// doesn't support the particular C++ feature yet. + void ErrorUnsupported(StringRef Feature, SourceLocation Location); + public: - VTableContext(ASTContext &Context) : Context(Context) {} + VTableContext(ASTContext &Context); ~VTableContext(); + bool isMicrosoftABI() const { + // FIXME: Currently, this method is only used in the VTableContext and + // VTableBuilder code which is ABI-specific. Probably we can remove it + // when we add a layer of abstraction for vtable generation. + return IsMicrosoftABI; + } + const VTableLayout &getVTableLayout(const CXXRecordDecl *RD) { ComputeVTableRelatedInformation(RD); assert(VTableLayouts.count(RD) && "No layout for this record decl!"); |