[cfe-commits] r91041 - in /cfe/trunk/lib/CodeGen: CGCXX.cpp CodeGenFunction.cpp CodeGenFunction.h

Eli Friedman eli.friedman at gmail.com
Wed Dec 9 18:21:21 PST 2009


Author: efriedma
Date: Wed Dec  9 20:21:21 2009
New Revision: 91041

URL: http://llvm.org/viewvc/llvm-project?rev=91041&view=rev
Log:
Get rid of static variable.


Modified:
    cfe/trunk/lib/CodeGen/CGCXX.cpp
    cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
    cfe/trunk/lib/CodeGen/CodeGenFunction.h

Modified: cfe/trunk/lib/CodeGen/CGCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXX.cpp?rev=91041&r1=91040&r2=91041&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXX.cpp Wed Dec  9 20:21:21 2009
@@ -465,7 +465,6 @@
 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 @@
   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);

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=91041&r1=91040&r2=91041&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Wed Dec  9 20:21:21 2009
@@ -31,7 +31,8 @@
     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;

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=91041&r1=91040&r2=91041&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Wed Dec  9 20:21:21 2009
@@ -424,7 +424,8 @@
   unsigned getByRefValueLLVMField(const ValueDecl *VD) const;
 
   llvm::BasicBlock *TerminateHandler;
-  
+
+  int UniqueAggrDestructorCount;
 public:
   CodeGenFunction(CodeGenModule &cgm);
 





More information about the cfe-commits mailing list