From 7270ee4cd4794281c09dfb6931a98bbb2581ef02 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Tue, 23 Mar 2010 04:31:31 +0000 Subject: Always emit associated thunks when emitting the function itself. Remove getVtableAddressPoint, it's not used. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99252 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 50ac7a31fc..1606710bc5 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -714,20 +714,9 @@ void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD) { Context.getSourceManager(), "Generating code for declaration"); - if (const CXXMethodDecl *MD = dyn_cast(D)) { + if (isa(D)) getVTables().EmitVTableRelatedData(GD); - if (MD->isVirtual() && MD->isOutOfLine() && - (!isa(D) || GD.getDtorType() != Dtor_Base)) { - if (isa(D)) { - GlobalDecl CanonGD(cast(D->getCanonicalDecl()), - GD.getDtorType()); - BuildThunksForVirtual(CanonGD); - } else { - BuildThunksForVirtual(MD->getCanonicalDecl()); - } - } - } - + if (const CXXConstructorDecl *CD = dyn_cast(D)) EmitCXXConstructor(CD, GD.getCtorType()); else if (const CXXDestructorDecl *DD = dyn_cast(D)) @@ -758,7 +747,7 @@ CodeGenModule::GetOrCreateLLVMFunction(llvm::StringRef MangledName, if (WeakRefReferences.count(Entry)) { const FunctionDecl *FD = cast_or_null(D.getDecl()); if (FD && !FD->hasAttr()) - Entry->setLinkage(llvm::Function::ExternalLinkage); + Entry->setLinkage(llvm::Function::ExternalLinkage); WeakRefReferences.erase(Entry); } @@ -873,7 +862,7 @@ CodeGenModule::GetOrCreateLLVMGlobal(llvm::StringRef MangledName, if (Entry) { if (WeakRefReferences.count(Entry)) { if (D && !D->hasAttr()) - Entry->setLinkage(llvm::Function::ExternalLinkage); + Entry->setLinkage(llvm::Function::ExternalLinkage); WeakRefReferences.erase(Entry); } -- cgit v1.2.3-18-g5258