From: Anders Carlsson Date: Sat, 2 Jan 2010 18:02:32 +0000 (+0000) Subject: Move address points to CGVtableInfo, no functionality change. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=21431c551d867962c66c92f0f96f652678f64c1c;p=clang Move address points to CGVtableInfo, no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92420 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp index 64568d2e6f..ab3fece90f 100644 --- a/lib/CodeGen/CGClass.cpp +++ b/lib/CodeGen/CGClass.cpp @@ -1359,8 +1359,8 @@ void CodeGenFunction::InitializeVtablePtrs(const CXXRecordDecl *ClassDecl) { return; llvm::Constant *Vtable = CGM.getVtableInfo().getVtable(ClassDecl); - CodeGenModule::AddrSubMap_t& AddressPoints = - *(*CGM.AddressPoints[ClassDecl])[ClassDecl]; + CGVtableInfo::AddrSubMap_t& AddressPoints = + *(*CGM.getVtableInfo().AddressPoints[ClassDecl])[ClassDecl]; llvm::Value *ThisPtr = LoadCXXThis(); const ASTRecordLayout &Layout = getContext().getASTRecordLayout(ClassDecl); @@ -1382,7 +1382,7 @@ void CodeGenFunction::InitializeVtablePtrs(const CXXRecordDecl *ClassDecl) { void CodeGenFunction::InitializeVtablePtrsRecursive( const CXXRecordDecl *ClassDecl, llvm::Constant *Vtable, - CodeGenModule::AddrSubMap_t& AddressPoints, + CGVtableInfo::AddrSubMap_t& AddressPoints, llvm::Value *ThisPtr, uint64_t Offset) { if (!ClassDecl->isDynamicClass()) diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp index 98f3907a67..ba5a0c3543 100644 --- a/lib/CodeGen/CGVtable.cpp +++ b/lib/CodeGen/CGVtable.cpp @@ -167,9 +167,9 @@ private: static llvm::DenseMap& AllocAddressPoint(CodeGenModule &cgm, const CXXRecordDecl *l, const CXXRecordDecl *c) { - CodeGenModule::AddrMap_t *&oref = cgm.AddressPoints[l]; + CGVtableInfo::AddrMap_t *&oref = cgm.getVtableInfo().AddressPoints[l]; if (oref == 0) - oref = new CodeGenModule::AddrMap_t; + oref = new CGVtableInfo::AddrMap_t; llvm::DenseMap *&ref = (*oref)[c]; if (ref == 0) @@ -1137,7 +1137,7 @@ int64_t CGVtableInfo::getVirtualBaseOffsetIndex(const CXXRecordDecl *RD, uint64_t CGVtableInfo::getVtableAddressPoint(const CXXRecordDecl *RD) { uint64_t AddressPoint = - (*(*(CGM.AddressPoints[RD]))[RD])[std::make_pair(RD, 0)]; + (*(*(CGM.getVtableInfo().AddressPoints[RD]))[RD])[std::make_pair(RD, 0)]; return AddressPoint; } @@ -1156,7 +1156,8 @@ CGVtableInfo::GenerateVtable(llvm::GlobalVariable::LinkageTypes Linkage, llvm::StringRef Name = OutName.str(); llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name); - if (GV == 0 || CGM.AddressPoints[LayoutClass] == 0 || GV->isDeclaration()) { + if (GV == 0 || CGM.getVtableInfo().AddressPoints[LayoutClass] == 0 || + GV->isDeclaration()) { VtableBuilder b(RD, LayoutClass, Offset, CGM, GenerateDefinition); D1(printf("vtable %s\n", RD->getNameAsCString())); @@ -1204,7 +1205,7 @@ class VTTBuilder { /// BLayout - Layout for the most derived class that this vtable is being /// built for. const ASTRecordLayout &BLayout; - CodeGenModule::AddrMap_t &AddressPoints; + CGVtableInfo::AddrMap_t &AddressPoints; // vtbl - A pointer to the vtable for Class. llvm::Constant *ClassVtbl; llvm::LLVMContext &VMContext; @@ -1365,7 +1366,7 @@ public: CodeGenModule &cgm, bool GenerateDefinition) : Inits(inits), Class(c), CGM(cgm), BLayout(cgm.getContext().getASTRecordLayout(c)), - AddressPoints(*cgm.AddressPoints[c]), + AddressPoints(*cgm.getVtableInfo().AddressPoints[c]), VMContext(cgm.getModule().getContext()), GenerateDefinition(GenerateDefinition) { diff --git a/lib/CodeGen/CGVtable.h b/lib/CodeGen/CGVtable.h index b1b48236e3..d1ffe7daa9 100644 --- a/lib/CodeGen/CGVtable.h +++ b/lib/CodeGen/CGVtable.h @@ -66,6 +66,11 @@ public: typedef std::vector > AdjustmentVectorTy; + typedef std::pair CtorVtable_t; + typedef llvm::DenseMap AddrSubMap_t; + typedef llvm::DenseMap AddrMap_t; + llvm::DenseMap AddressPoints; + private: CodeGenModule &CGM; diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index fadb38fcb9..2879d69f89 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -517,7 +517,7 @@ public: void InitializeVtablePtrsRecursive(const CXXRecordDecl *ClassDecl, llvm::Constant *Vtable, - CodeGenModule::AddrSubMap_t& AddressPoints, + CGVtableInfo::AddrSubMap_t& AddressPoints, llvm::Value *ThisPtr, uint64_t Offset); diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h index 939c66ca31..a31e23b2c7 100644 --- a/lib/CodeGen/CodeGenModule.h +++ b/lib/CodeGen/CodeGenModule.h @@ -232,11 +232,6 @@ public: BuildCovariantThunk(const GlobalDecl &GD, bool Extern, const CovariantThunkAdjustment &Adjustment); - typedef std::pair CtorVtable_t; - typedef llvm::DenseMap AddrSubMap_t; - typedef llvm::DenseMap AddrMap_t; - llvm::DenseMap AddressPoints; - /// GetCXXBaseClassOffset - Returns the offset from a derived class to its /// base class. Returns null if the offset is 0. llvm::Constant *GetCXXBaseClassOffset(const CXXRecordDecl *ClassDecl,