diff options
| author | Anders Carlsson <andersca@mac.com> | 2010-03-25 15:26:28 +0000 |
|---|---|---|
| committer | Anders Carlsson <andersca@mac.com> | 2010-03-25 15:26:28 +0000 |
| commit | a4147148ff2ffe2f78f6f03a0d48f087dd8ec284 (patch) | |
| tree | e630298ba6b6ab6dea43a38f4d010968ab7025d4 /clang/lib/CodeGen/CGVtable.h | |
| parent | 95cd4b9c0aab70a3d94833082ab50c52f179743a (diff) | |
| download | bcm5719-llvm-a4147148ff2ffe2f78f6f03a0d48f087dd8ec284.tar.gz bcm5719-llvm-a4147148ff2ffe2f78f6f03a0d48f087dd8ec284.zip | |
When -fdump-vtable-layouts is specified, construction vtable initializers will be generated using the new vtable layout code. (The code is still not completely in place but this is a huge step forward).
llvm-svn: 99508
Diffstat (limited to 'clang/lib/CodeGen/CGVtable.h')
| -rw-r--r-- | clang/lib/CodeGen/CGVtable.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGVtable.h b/clang/lib/CodeGen/CGVtable.h index d2acba03228..18de02a705d 100644 --- a/clang/lib/CodeGen/CGVtable.h +++ b/clang/lib/CodeGen/CGVtable.h @@ -274,6 +274,15 @@ private: /// Address points - Vtable address points. AddressPointsMapTy AddressPoints; + typedef llvm::SmallVector<std::pair<uint64_t, ThunkInfo>, 1> + VTableThunksTy; + + typedef llvm::DenseMap<const CXXRecordDecl *, VTableThunksTy> + VTableThunksMapTy; + + /// VTableThunksMap - Contains thunks needed by vtables. + VTableThunksMapTy VTableThunksMap; + uint64_t getNumVTableComponents(const CXXRecordDecl *RD) const { assert(VTableLayoutMap.count(RD) && "No vtable layout for this class!"); @@ -310,6 +319,15 @@ private: /// given record decl. void ComputeVTableRelatedInformation(const CXXRecordDecl *RD); + /// CreateVTableInitializer - Create a vtable initializer for the given record + /// decl. + /// \param Components - The vtable components; this is really an array of + /// VTableComponents. + llvm::Constant *CreateVTableInitializer(const CXXRecordDecl *RD, + const uint64_t *Components, + unsigned NumComponents, + const VTableThunksTy &VTableThunks); + public: CodeGenVTables(CodeGenModule &CGM) : CGM(CGM) { } |

