From af82f63b47543f228e22d4c3de559249253bc187 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. llvm-svn: 99252 --- clang/lib/CodeGen/CodeGenModule.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 50ac7a31fca7..1606710bc5cd 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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