Author: Reid Kleckner
Date: 2025-04-23T22:30:44Z
New Revision: 0e0a1665fa340b9f1934d12aff818064aaf289ef

URL: 
https://github.com/llvm/llvm-project/commit/0e0a1665fa340b9f1934d12aff818064aaf289ef
DIFF: 
https://github.com/llvm/llvm-project/commit/0e0a1665fa340b9f1934d12aff818064aaf289ef.diff

LOG: Revert unintentional diff from cd826d6e840ed33ad88458c862da5f9fcc6e908c

This is part of a forthcoming fix for issues observed in #91310, and was
unintentionally committed as part of the VTT type changes revert

Added: 
    

Modified: 
    clang/lib/CodeGen/CodeGenModule.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CodeGenModule.cpp 
b/clang/lib/CodeGen/CodeGenModule.cpp
index a073c5d54f8ab..83d8d4f758195 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -5837,24 +5837,15 @@ void CodeGenModule::EmitExternalVarDeclaration(const 
VarDecl *D) {
     }
 }
 
-static GlobalDecl getBaseVariantGlobalDecl(const FunctionDecl *FD) {
-  if (auto const *CD = dyn_cast<const CXXConstructorDecl>(FD))
-    return GlobalDecl(CD, CXXCtorType::Ctor_Base);
-  else if (auto const *DD = dyn_cast<const CXXDestructorDecl>(FD))
-    return GlobalDecl(DD, CXXDtorType::Dtor_Base);
-  return GlobalDecl(FD);
-}
-
 void CodeGenModule::EmitExternalFunctionDeclaration(const FunctionDecl *FD) {
   if (CGDebugInfo *DI = getModuleDebugInfo())
     if (getCodeGenOpts().hasReducedDebugInfo()) {
-      GlobalDecl GD = getBaseVariantGlobalDecl(FD);
       auto *Ty = getTypes().ConvertType(FD->getType());
-      StringRef MangledName = getMangledName(GD);
+      StringRef MangledName = getMangledName(FD);
       auto *Fn = cast<llvm::Function>(
-          GetOrCreateLLVMFunction(MangledName, Ty, GD, /* ForVTable */ false));
+          GetOrCreateLLVMFunction(MangledName, Ty, FD, /* ForVTable */ false));
       if (!Fn->getSubprogram())
-        DI->EmitFunctionDecl(GD, FD->getLocation(), FD->getType(), Fn);
+        DI->EmitFunctionDecl(FD, FD->getLocation(), FD->getType(), Fn);
     }
 }
 


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to