@@ -5837,24 +5837,15 @@ void CodeGenModule::EmitExternalVarDeclaration(const VarDecl *D) {
58375837 }
58385838}
58395839
5840- static GlobalDecl getBaseVariantGlobalDecl (const FunctionDecl *FD) {
5841- if (auto const *CD = dyn_cast<const CXXConstructorDecl>(FD))
5842- return GlobalDecl (CD, CXXCtorType::Ctor_Base);
5843- else if (auto const *DD = dyn_cast<const CXXDestructorDecl>(FD))
5844- return GlobalDecl (DD, CXXDtorType::Dtor_Base);
5845- return GlobalDecl (FD);
5846- }
5847-
58485840void CodeGenModule::EmitExternalFunctionDeclaration (const FunctionDecl *FD) {
58495841 if (CGDebugInfo *DI = getModuleDebugInfo ())
58505842 if (getCodeGenOpts ().hasReducedDebugInfo ()) {
5851- GlobalDecl GD = getBaseVariantGlobalDecl (FD);
58525843 auto *Ty = getTypes ().ConvertType (FD->getType ());
5853- StringRef MangledName = getMangledName (GD );
5844+ StringRef MangledName = getMangledName (FD );
58545845 auto *Fn = cast<llvm::Function>(
5855- GetOrCreateLLVMFunction (MangledName, Ty, GD , /* ForVTable */ false ));
5846+ GetOrCreateLLVMFunction (MangledName, Ty, FD , /* ForVTable */ false ));
58565847 if (!Fn->getSubprogram ())
5857- DI->EmitFunctionDecl (GD , FD->getLocation (), FD->getType (), Fn);
5848+ DI->EmitFunctionDecl (FD , FD->getLocation (), FD->getType (), Fn);
58585849 }
58595850}
58605851
0 commit comments