summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/CGVTT.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-09-26 01:56:10 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2011-09-26 01:56:10 +0000
commit4c341ac59cdbf5f0235478424dec6af1f57ebb7a (patch)
treef619263d0b60327d2ac810b79de5d704aa845f31 /lib/CodeGen/CGVTT.cpp
parente2ff5abe47e12d63341b76f0f8e311aa9dbc3f94 (diff)
Remove CodeGenModule field from VTTBuilder
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140499 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVTT.cpp')
-rw-r--r--lib/CodeGen/CGVTT.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/CodeGen/CGVTT.cpp b/lib/CodeGen/CGVTT.cpp
index e1a7b51b54..0e02ff312b 100644
--- a/lib/CodeGen/CGVTT.cpp
+++ b/lib/CodeGen/CGVTT.cpp
@@ -62,7 +62,7 @@ struct VTTComponent {
/// VTT builder - Class for building VTT layout information.
class VTTBuilder {
- CodeGenModule &CGM;
+ ASTContext &Ctx;
/// MostDerivedClass - The most derived class for which we're building this
/// vtable.
@@ -140,7 +140,7 @@ class VTTBuilder {
void LayoutVTT(BaseSubobject Base, bool BaseIsVirtual);
public:
- VTTBuilder(CodeGenModule &CGM, const CXXRecordDecl *MostDerivedClass,
+ VTTBuilder(ASTContext &Ctx, const CXXRecordDecl *MostDerivedClass,
bool GenerateDefinition);
// getVTTComponents - Returns a reference to the VTT components.
@@ -167,11 +167,11 @@ public:
};
-VTTBuilder::VTTBuilder(CodeGenModule &CGM,
+VTTBuilder::VTTBuilder(ASTContext &Ctx,
const CXXRecordDecl *MostDerivedClass,
bool GenerateDefinition)
- : CGM(CGM), MostDerivedClass(MostDerivedClass),
- MostDerivedClassLayout(CGM.getContext().getASTRecordLayout(MostDerivedClass)),
+ : Ctx(Ctx), MostDerivedClass(MostDerivedClass),
+ MostDerivedClassLayout(Ctx.getASTRecordLayout(MostDerivedClass)),
GenerateDefinition(GenerateDefinition) {
// Lay out this VTT.
LayoutVTT(BaseSubobject(MostDerivedClass, CharUnits::Zero()),
@@ -227,7 +227,7 @@ void VTTBuilder::LayoutSecondaryVTTs(BaseSubobject Base) {
const CXXRecordDecl *BaseDecl =
cast<CXXRecordDecl>(I->getType()->getAs<RecordType>()->getDecl());
- const ASTRecordLayout &Layout = CGM.getContext().getASTRecordLayout(RD);
+ const ASTRecordLayout &Layout = Ctx.getASTRecordLayout(RD);
CharUnits BaseOffset = Base.getBaseOffset() +
Layout.getBaseClassOffset(BaseDecl);
@@ -275,7 +275,7 @@ VTTBuilder::LayoutSecondaryVirtualPointers(BaseSubobject Base,
BaseOffset = MostDerivedClassLayout.getVBaseClassOffset(BaseDecl);
BaseDeclIsMorallyVirtual = true;
} else {
- const ASTRecordLayout &Layout = CGM.getContext().getASTRecordLayout(RD);
+ const ASTRecordLayout &Layout = Ctx.getASTRecordLayout(RD);
BaseOffset = Base.getBaseOffset() +
Layout.getBaseClassOffset(BaseDecl);
@@ -379,7 +379,7 @@ void
CodeGenVTables::EmitVTTDefinition(llvm::GlobalVariable *VTT,
llvm::GlobalVariable::LinkageTypes Linkage,
const CXXRecordDecl *RD) {
- VTTBuilder Builder(CGM, RD, /*GenerateDefinition=*/true);
+ VTTBuilder Builder(CGM.getContext(), RD, /*GenerateDefinition=*/true);
llvm::Type *Int8PtrTy = llvm::Type::getInt8PtrTy(CGM.getLLVMContext()),
*Int64Ty = llvm::Type::getInt64Ty(CGM.getLLVMContext());
@@ -445,7 +445,7 @@ llvm::GlobalVariable *CodeGenVTables::GetAddrOfVTT(const CXXRecordDecl *RD) {
ComputeVTableRelatedInformation(RD, /*VTableRequired=*/true);
- VTTBuilder Builder(CGM, RD, /*GenerateDefinition=*/false);
+ VTTBuilder Builder(CGM.getContext(), RD, /*GenerateDefinition=*/false);
llvm::Type *Int8PtrTy =
llvm::Type::getInt8PtrTy(CGM.getLLVMContext());
@@ -485,7 +485,7 @@ uint64_t CodeGenVTables::getSubVTTIndex(const CXXRecordDecl *RD,
if (I != SubVTTIndicies.end())
return I->second;
- VTTBuilder Builder(CGM, RD, /*GenerateDefinition=*/false);
+ VTTBuilder Builder(CGM.getContext(), RD, /*GenerateDefinition=*/false);
for (llvm::DenseMap<BaseSubobject, uint64_t>::const_iterator I =
Builder.getSubVTTIndicies().begin(),
@@ -511,7 +511,7 @@ CodeGenVTables::getSecondaryVirtualPointerIndex(const CXXRecordDecl *RD,
if (I != SecondaryVirtualPointerIndices.end())
return I->second;
- VTTBuilder Builder(CGM, RD, /*GenerateDefinition=*/false);
+ VTTBuilder Builder(CGM.getContext(), RD, /*GenerateDefinition=*/false);
// Insert all secondary vpointer indices.
for (llvm::DenseMap<BaseSubobject, uint64_t>::const_iterator I =