diff options
author | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
commit | c72c57c9e9b69944e3e009cd5e209634839581d3 (patch) | |
tree | 4fc2f184c499d106f29a386c452b49e5197bf63d /include/clang/AST/VTableBuilder.h | |
parent | 5b20025c30d23d521e12c1f33ec8fa6b821952cd (diff) | |
download | FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.zip FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.tar.gz |
Vendor import of clang trunk r178860:
http://llvm.org/svn/llvm-project/cfe/trunk@178860
Diffstat (limited to 'include/clang/AST/VTableBuilder.h')
-rw-r--r-- | include/clang/AST/VTableBuilder.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/include/clang/AST/VTableBuilder.h b/include/clang/AST/VTableBuilder.h index a6aa40b..bcbe875 100644 --- a/include/clang/AST/VTableBuilder.h +++ b/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!"); |