diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-12-10 02:21:21 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-12-10 02:21:21 +0000 |
commit | 940670512d7c3d93389bb38a426abcb7ef44271e (patch) | |
tree | 2cd40e7c49c36e0270998dc47684973cf35698e1 /lib/CodeGen | |
parent | 932dff777d58a23e3a26967a61bb52697c542fd4 (diff) |
Get rid of static variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91041 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGCXX.cpp | 3 | ||||
-rw-r--r-- | lib/CodeGen/CodeGenFunction.cpp | 3 | ||||
-rw-r--r-- | lib/CodeGen/CodeGenFunction.h | 3 |
3 files changed, 5 insertions, 4 deletions
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp index 195f3da326..692dea6f03 100644 --- a/lib/CodeGen/CGCXX.cpp +++ b/lib/CodeGen/CGCXX.cpp @@ -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); diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index 18442bb159..26964529ea 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -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; diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index cf267c4167..1ddfa6d6c0 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -424,7 +424,8 @@ private: unsigned getByRefValueLLVMField(const ValueDecl *VD) const; llvm::BasicBlock *TerminateHandler; - + + int UniqueAggrDestructorCount; public: CodeGenFunction(CodeGenModule &cgm); |