diff options
author | Reid Kleckner <reid@kleckner.net> | 2013-12-20 23:58:52 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2013-12-20 23:58:52 +0000 |
commit | b60a3d5bc1de66dfe7532d249d75ba8f4e9d14e7 (patch) | |
tree | d408e7a7af3b5fd1e4b6a5ff22f82f95e518a067 /clang/lib/CodeGen/CGVTables.cpp | |
parent | 3275dc4586eea2b769955e1c7160f2cb99f7a010 (diff) | |
download | bcm5719-llvm-b60a3d5bc1de66dfe7532d249d75ba8f4e9d14e7.tar.gz bcm5719-llvm-b60a3d5bc1de66dfe7532d249d75ba8f4e9d14e7.zip |
Eliminate the ItaniumVTableContext object from CodeGenVTables
Now CodeGenVTables has only one VTableContext object, which is either
Itanium or Microsoft.
Fixes a FIXME with no functionality change intended.
Ideally we could avoid the downcasts by pushing the things that
reference the Itanium vtable context into ItaniumCXXABI.cpp, but we're
not there yet.
llvm-svn: 197845
Diffstat (limited to 'clang/lib/CodeGen/CGVTables.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGVTables.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/clang/lib/CodeGen/CGVTables.cpp b/clang/lib/CodeGen/CGVTables.cpp index a5967fddf24..2edce5d27dd 100644 --- a/clang/lib/CodeGen/CGVTables.cpp +++ b/clang/lib/CodeGen/CGVTables.cpp @@ -29,14 +29,11 @@ using namespace clang; using namespace CodeGen; -CodeGenVTables::CodeGenVTables(CodeGenModule &CGM) - : CGM(CGM), ItaniumVTContext(CGM.getContext()) { - if (CGM.getTarget().getCXXABI().isMicrosoft()) { - // FIXME: Eventually, we should only have one of V*TContexts available. - // Today we use both in the Microsoft ABI as MicrosoftVFTableContext - // is not completely supported in CodeGen yet. - MicrosoftVTContext.reset(new MicrosoftVTableContext(CGM.getContext())); - } +CodeGenVTables::CodeGenVTables(CodeGenModule &CGM) : CGM(CGM) { + if (CGM.getTarget().getCXXABI().isMicrosoft()) + VTContext.reset(new MicrosoftVTableContext(CGM.getContext())); + else + VTContext.reset(new ItaniumVTableContext(CGM.getContext())); } llvm::Constant *CodeGenModule::GetAddrOfThunk(GlobalDecl GD, @@ -465,12 +462,8 @@ void CodeGenVTables::EmitThunks(GlobalDecl GD) if (isa<CXXDestructorDecl>(MD) && GD.getDtorType() == Dtor_Base) return; - const VTableContextBase::ThunkInfoVectorTy *ThunkInfoVector; - if (MicrosoftVTContext.isValid()) { - ThunkInfoVector = MicrosoftVTContext->getThunkInfo(GD); - } else { - ThunkInfoVector = ItaniumVTContext.getThunkInfo(GD); - } + const VTableContextBase::ThunkInfoVectorTy *ThunkInfoVector = + VTContext->getThunkInfo(GD); if (!ThunkInfoVector) return; @@ -608,7 +601,7 @@ CodeGenVTables::GenerateConstructionVTable(const CXXRecordDecl *RD, DI->completeClassData(Base.getBase()); OwningPtr<VTableLayout> VTLayout( - ItaniumVTContext.createConstructionVTableLayout( + getItaniumVTableContext().createConstructionVTableLayout( Base.getBase(), Base.getBaseOffset(), BaseIsVirtual, RD)); // Add the address points. |