diff options
Diffstat (limited to 'contrib/llvm/tools/clang/lib/CodeGen/CGVTables.h')
-rw-r--r-- | contrib/llvm/tools/clang/lib/CodeGen/CGVTables.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.h b/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.h index e55377f..abcafd6 100644 --- a/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.h +++ b/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.h @@ -207,8 +207,12 @@ class CodeGenVTables { /// Thunks - Contains all thunks that a given method decl will need. ThunksMapTy Thunks; - - typedef llvm::DenseMap<const CXXRecordDecl *, uint64_t *> VTableLayoutMapTy; + + // The layout entry and a bool indicating whether we've actually emitted + // the vtable. + typedef llvm::PointerIntPair<uint64_t *, 1, bool> VTableLayoutData; + typedef llvm::DenseMap<const CXXRecordDecl *, VTableLayoutData> + VTableLayoutMapTy; /// VTableLayoutMap - Stores the vtable layout for all record decls. /// The layout is stored as an array of 64-bit integers, where the first @@ -237,13 +241,13 @@ class CodeGenVTables { uint64_t getNumVTableComponents(const CXXRecordDecl *RD) const { assert(VTableLayoutMap.count(RD) && "No vtable layout for this class!"); - return VTableLayoutMap.lookup(RD)[0]; + return VTableLayoutMap.lookup(RD).getPointer()[0]; } const uint64_t *getVTableComponentsData(const CXXRecordDecl *RD) const { assert(VTableLayoutMap.count(RD) && "No vtable layout for this class!"); - uint64_t *Components = VTableLayoutMap.lookup(RD); + uint64_t *Components = VTableLayoutMap.lookup(RD).getPointer(); return &Components[1]; } @@ -275,7 +279,8 @@ class CodeGenVTables { /// ComputeVTableRelatedInformation - Compute and store all vtable related /// information (vtable layout, vbase offset offsets, thunks etc) for the /// given record decl. - void ComputeVTableRelatedInformation(const CXXRecordDecl *RD); + void ComputeVTableRelatedInformation(const CXXRecordDecl *RD, + bool VTableRequired); /// CreateVTableInitializer - Create a vtable initializer for the given record /// decl. @@ -296,7 +301,7 @@ public: const CXXRecordDecl *RD) { assert (RD->isDynamicClass() && "Non dynamic classes have no key."); const CXXMethodDecl *KeyFunction = Context.getKeyFunction(RD); - return KeyFunction && !KeyFunction->getBody(); + return KeyFunction && !KeyFunction->hasBody(); } /// needsVTTParameter - Return whether the given global decl needs a VTT |