Rename __tcf_ to __cxx_global_array_dtor. Remove the UniqueAggreDestructorCount from CodeGenFunction and let LLVM handle uniquing the internal functions instead.

llvm-svn: 105648
This commit is contained in:
Anders Carlsson 2010-06-08 22:30:17 +00:00
parent 282bc10eaa
commit 9eb101c5d3
3 changed files with 3 additions and 6 deletions

View File

@ -436,14 +436,13 @@ CodeGenFunction::GenerateCXXAggrDestructorHelper(const CXXDestructorDecl *D,
getContext().getPointerType(getContext().VoidTy)); getContext().getPointerType(getContext().VoidTy));
Args.push_back(std::make_pair(Dst, Dst->getType())); Args.push_back(std::make_pair(Dst, Dst->getType()));
llvm::SmallString<16> Name;
llvm::raw_svector_ostream(Name) << "__tcf_" << (++UniqueAggrDestructorCount);
const CGFunctionInfo &FI = const CGFunctionInfo &FI =
CGM.getTypes().getFunctionInfo(getContext().VoidTy, Args, CGM.getTypes().getFunctionInfo(getContext().VoidTy, Args,
FunctionType::ExtInfo()); FunctionType::ExtInfo());
const llvm::FunctionType *FTy = CGM.getTypes().GetFunctionType(FI, false); const llvm::FunctionType *FTy = CGM.getTypes().GetFunctionType(FI, false);
llvm::Function *Fn = 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()); &CGM.getModule());
StartFunction(GlobalDecl(), getContext().VoidTy, Fn, Args, SourceLocation()); StartFunction(GlobalDecl(), getContext().VoidTy, Fn, Args, SourceLocation());

View File

@ -31,8 +31,7 @@ CodeGenFunction::CodeGenFunction(CodeGenModule &cgm)
DebugInfo(0), IndirectBranch(0), DebugInfo(0), IndirectBranch(0),
SwitchInsn(0), CaseRangeBlock(0), InvokeDest(0), SwitchInsn(0), CaseRangeBlock(0), InvokeDest(0),
CXXThisDecl(0), CXXThisValue(0), CXXVTTDecl(0), CXXVTTValue(0), CXXThisDecl(0), CXXThisValue(0), CXXVTTDecl(0), CXXVTTValue(0),
ConditionalBranchLevel(0), TerminateHandler(0), TrapBB(0), ConditionalBranchLevel(0), TerminateHandler(0), TrapBB(0) {
UniqueAggrDestructorCount(0) {
LLVMIntTy = ConvertType(getContext().IntTy); LLVMIntTy = ConvertType(getContext().IntTy);
LLVMPointerWidth = Target.getPointerWidth(0); LLVMPointerWidth = Target.getPointerWidth(0);
Exceptions = getContext().getLangOptions().Exceptions; Exceptions = getContext().getLangOptions().Exceptions;

View File

@ -456,7 +456,6 @@ private:
llvm::BasicBlock *TerminateHandler; llvm::BasicBlock *TerminateHandler;
llvm::BasicBlock *TrapBB; llvm::BasicBlock *TrapBB;
int UniqueAggrDestructorCount;
public: public:
CodeGenFunction(CodeGenModule &cgm); CodeGenFunction(CodeGenModule &cgm);