Author: Kazu Hirata Date: 2023-06-14T22:04:40-07:00 New Revision: 8fd80d1d136685688ff49c9d80552bbb7addbda4
URL: https://github.com/llvm/llvm-project/commit/8fd80d1d136685688ff49c9d80552bbb7addbda4 DIFF: https://github.com/llvm/llvm-project/commit/8fd80d1d136685688ff49c9d80552bbb7addbda4.diff LOG: [CodeGen] Remove unused function GetOrCreateRTTIProxyGlobalVariable The last use was removed by: commit 46f366494f3ca8cc98daa6fb4f29c7c446c176b6 Author: Fangrui Song <i...@maskray.me> Date: Sat May 20 08:24:20 2023 -0700 This patch also removes RTTIProxyMap, which becomes unused once I remove GetOrCreateRTTIProxyGlobalVariable. Differential Revision: https://reviews.llvm.org/D152782 Added: Modified: clang/lib/CodeGen/CodeGenModule.cpp clang/lib/CodeGen/CodeGenModule.h Removed: ################################################################################ diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index dd8c384d13171..8b2fa5eaf5ba1 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -2028,22 +2028,6 @@ CodeGenModule::getMostBaseClasses(const CXXRecordDecl *RD) { return MostBases.takeVector(); } -llvm::GlobalVariable * -CodeGenModule::GetOrCreateRTTIProxyGlobalVariable(llvm::Constant *Addr) { - auto It = RTTIProxyMap.find(Addr); - if (It != RTTIProxyMap.end()) - return It->second; - - auto *FTRTTIProxy = new llvm::GlobalVariable( - TheModule, Addr->getType(), - /*isConstant=*/true, llvm::GlobalValue::PrivateLinkage, Addr, - "__llvm_rtti_proxy"); - FTRTTIProxy->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global); - - RTTIProxyMap[Addr] = FTRTTIProxy; - return FTRTTIProxy; -} - void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D, llvm::Function *F) { llvm::AttrBuilder B(F->getContext()); diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 43d61b40f76b4..2d2cce8337195 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -590,8 +590,6 @@ class CodeGenModule : public CodeGenTypeCache { MetadataTypeMap VirtualMetadataIdMap; MetadataTypeMap GeneralizedMetadataIdMap; - llvm::DenseMap<const llvm::Constant *, llvm::GlobalVariable *> RTTIProxyMap; - // Helps squashing blocks of TopLevelStmtDecl into a single llvm::Function // when used with -fincremental-extensions. std::pair<std::unique_ptr<CodeGenFunction>, const TopLevelStmtDecl *> @@ -1503,9 +1501,6 @@ class CodeGenModule : public CodeGenTypeCache { std::vector<const CXXRecordDecl *> getMostBaseClasses(const CXXRecordDecl *RD); - llvm::GlobalVariable * - GetOrCreateRTTIProxyGlobalVariable(llvm::Constant *Addr); - /// Get the declaration of std::terminate for the platform. llvm::FunctionCallee getTerminateFn(); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits