[cfe-commits] r106503 - /cfe/trunk/lib/CodeGen/CGDeclCXX.cpp

Fariborz Jahanian fjahanian at apple.com
Mon Jun 21 18:31:29 CDT 2010


Author: fjahanian
Date: Mon Jun 21 18:31:29 2010
New Revision: 106503

URL: http://llvm.org/viewvc/llvm-project?rev=106503&view=rev
Log:
Avoid using a local static for providing lexical
order of priorotized global object initializations.

Modified:
    cfe/trunk/lib/CodeGen/CGDeclCXX.cpp

Modified: cfe/trunk/lib/CodeGen/CGDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDeclCXX.cpp?rev=106503&r1=106502&r2=106503&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDeclCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDeclCXX.cpp Mon Jun 21 18:31:29 2010
@@ -172,10 +172,8 @@
   CodeGenFunction(*this).GenerateCXXGlobalVarDeclInitFunc(Fn, D);
 
   if (D->hasAttr<InitPriorityAttr>()) {
-    static unsigned lix = 0; // to keep the lexical order of equal priority
-                             // objects intact;
     unsigned int order = D->getAttr<InitPriorityAttr>()->getPriority();
-    OrderGlobalInitsType Key(order, lix++);
+    OrderGlobalInitsType Key(order, PrioritizedCXXGlobalInits.size());
     PrioritizedCXXGlobalInits.push_back(std::make_pair(Key, Fn));
   }
   else




More information about the cfe-commits mailing list