]> granicus.if.org Git - clang/commitdiff
Get rid of static variable.
authorEli Friedman <eli.friedman@gmail.com>
Thu, 10 Dec 2009 02:21:21 +0000 (02:21 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Thu, 10 Dec 2009 02:21:21 +0000 (02:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91041 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCXX.cpp
lib/CodeGen/CodeGenFunction.cpp
lib/CodeGen/CodeGenFunction.h

index 195f3da326a2372b1ac744df2ad085164ddfe6cb..692dea6f0306ba9b827a0a6bf2814d5454e1b5ef 100644 (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);
index 18442bb159038b4f317b8618251bd643a8606fb4..26964529ea6ff9a251b8ade0e1880444bb619a66 100644 (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;
index cf267c416763d3f4148e7285e7c07896182e7795..1ddfa6d6c02df54ef58804d60fee6bbda473f97f 100644 (file)
@@ -424,7 +424,8 @@ private:
   unsigned getByRefValueLLVMField(const ValueDecl *VD) const;
 
   llvm::BasicBlock *TerminateHandler;
-  
+
+  int UniqueAggrDestructorCount;
 public:
   CodeGenFunction(CodeGenModule &cgm);