From 8fd80d1d136685688ff49c9d80552bbb7addbda4 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Wed, 14 Jun 2023 22:04:40 -0700 Subject: [PATCH] [CodeGen] Remove unused function GetOrCreateRTTIProxyGlobalVariable The last use was removed by: commit 46f366494f3ca8cc98daa6fb4f29c7c446c176b6 Author: Fangrui Song 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 --- clang/lib/CodeGen/CodeGenModule.cpp | 16 ---------------- clang/lib/CodeGen/CodeGenModule.h | 5 ----- 2 files changed, 21 deletions(-) diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index dd8c384..8b2fa5e 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 43d61b4..2d2cce8 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -590,8 +590,6 @@ private: MetadataTypeMap VirtualMetadataIdMap; MetadataTypeMap GeneralizedMetadataIdMap; - llvm::DenseMap RTTIProxyMap; - // Helps squashing blocks of TopLevelStmtDecl into a single llvm::Function // when used with -fincremental-extensions. std::pair, const TopLevelStmtDecl *> @@ -1503,9 +1501,6 @@ public: std::vector getMostBaseClasses(const CXXRecordDecl *RD); - llvm::GlobalVariable * - GetOrCreateRTTIProxyGlobalVariable(llvm::Constant *Addr); - /// Get the declaration of std::terminate for the platform. llvm::FunctionCallee getTerminateFn(); -- 2.7.4