Get rid of static variable.

llvm-svn: 91041
This commit is contained in:
Eli Friedman
2009-12-10 02:21:21 +00:00
parent 3c674cf804
commit d5bc94e2eb
3 changed files with 5 additions and 4 deletions

View File

@@ -465,7 +465,6 @@ llvm::Constant *
CodeGenFunction::GenerateCXXAggrDestructorHelper(const CXXDestructorDecl *D,
const ArrayType *Array,
llvm::Value *This) {
static int UniqueCount;
FunctionArgList Args;
ImplicitParamDecl *Dst =
ImplicitParamDecl::Create(getContext(), 0,
@@ -474,7 +473,7 @@ CodeGenFunction::GenerateCXXAggrDestructorHelper(const CXXDestructorDecl *D,
Args.push_back(std::make_pair(Dst, Dst->getType()));
llvm::SmallString<16> Name;
llvm::raw_svector_ostream(Name) << "__tcf_" << (++UniqueCount);
llvm::raw_svector_ostream(Name) << "__tcf_" << (++UniqueAggrDestructorCount);
QualType R = getContext().VoidTy;
const CGFunctionInfo &FI = CGM.getTypes().getFunctionInfo(R, Args);
const llvm::FunctionType *FTy = CGM.getTypes().GetFunctionType(FI, false);

View File

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

View File

@@ -424,7 +424,8 @@ private:
unsigned getByRefValueLLVMField(const ValueDecl *VD) const;
llvm::BasicBlock *TerminateHandler;
int UniqueAggrDestructorCount;
public:
CodeGenFunction(CodeGenModule &cgm);