From 5687a5cb5941744c42aaaa9a1e7cd6d7c4c07fbf Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Tue, 8 Jun 2010 22:30:17 +0000 Subject: [PATCH] Rename __tcf_ to __cxx_global_array_dtor. Remove the UniqueAggreDestructorCount from CodeGenFunction and let LLVM handle uniquing the internal functions instead. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105648 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGDeclCXX.cpp | 5 ++--- lib/CodeGen/CodeGenFunction.cpp | 3 +-- lib/CodeGen/CodeGenFunction.h | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/CodeGen/CGDeclCXX.cpp b/lib/CodeGen/CGDeclCXX.cpp index 340f6a5a95..583e961787 100644 --- a/lib/CodeGen/CGDeclCXX.cpp +++ b/lib/CodeGen/CGDeclCXX.cpp @@ -436,14 +436,13 @@ CodeGenFunction::GenerateCXXAggrDestructorHelper(const CXXDestructorDecl *D, getContext().getPointerType(getContext().VoidTy)); Args.push_back(std::make_pair(Dst, Dst->getType())); - llvm::SmallString<16> Name; - llvm::raw_svector_ostream(Name) << "__tcf_" << (++UniqueAggrDestructorCount); const CGFunctionInfo &FI = CGM.getTypes().getFunctionInfo(getContext().VoidTy, Args, FunctionType::ExtInfo()); const llvm::FunctionType *FTy = CGM.getTypes().GetFunctionType(FI, false); llvm::Function *Fn = - llvm::Function::Create(FTy, llvm::GlobalValue::InternalLinkage, Name.str(), + llvm::Function::Create(FTy, llvm::GlobalValue::InternalLinkage, + "__cxx_global_array_dtor", &CGM.getModule()); StartFunction(GlobalDecl(), getContext().VoidTy, Fn, Args, SourceLocation()); diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index 73de0fd773..af062356f6 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -31,8 +31,7 @@ CodeGenFunction::CodeGenFunction(CodeGenModule &cgm) DebugInfo(0), IndirectBranch(0), SwitchInsn(0), CaseRangeBlock(0), InvokeDest(0), CXXThisDecl(0), CXXThisValue(0), CXXVTTDecl(0), CXXVTTValue(0), - ConditionalBranchLevel(0), TerminateHandler(0), TrapBB(0), - UniqueAggrDestructorCount(0) { + ConditionalBranchLevel(0), TerminateHandler(0), TrapBB(0) { LLVMIntTy = ConvertType(getContext().IntTy); LLVMPointerWidth = Target.getPointerWidth(0); Exceptions = getContext().getLangOptions().Exceptions; diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index 21c0857769..0682a0474b 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -456,7 +456,6 @@ private: llvm::BasicBlock *TerminateHandler; llvm::BasicBlock *TrapBB; - int UniqueAggrDestructorCount; public: CodeGenFunction(CodeGenModule &cgm); -- 2.40.0