summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-06-21 23:31:29 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-06-21 23:31:29 +0000
commit581c78fcb238bbc962176c3dd8399770343c26eb (patch)
tree012fc3ecfd44a54ad96f22969601bab189f0f4ca
parentf918b8328add31b17075def5f56e53a3c572b084 (diff)
downloadclang-581c78fcb238bbc962176c3dd8399770343c26eb.tar.gz
Avoid using a local static for providing lexical
order of priorotized global object initializations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106503 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGDeclCXX.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/CodeGen/CGDeclCXX.cpp b/lib/CodeGen/CGDeclCXX.cpp
index 9faaed5538..c2e2dd0ee4 100644
--- a/lib/CodeGen/CGDeclCXX.cpp
+++ b/lib/CodeGen/CGDeclCXX.cpp
@@ -172,10 +172,8 @@ CodeGenModule::EmitCXXGlobalVarDeclInitFunc(const VarDecl *D) {
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