diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-06-21 23:31:29 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-06-21 23:31:29 +0000 |
commit | c9fec975e6cf021d861bd399612da7656a7907f8 (patch) | |
tree | e0608f678e8fa9e37ff3c3c8644c2c7a35598a0b /clang/lib/CodeGen/CGDeclCXX.cpp | |
parent | 64960f55fef0743868ea10ba277d641da065ab25 (diff) | |
download | bcm5719-llvm-c9fec975e6cf021d861bd399612da7656a7907f8.tar.gz bcm5719-llvm-c9fec975e6cf021d861bd399612da7656a7907f8.zip |
Avoid using a local static for providing lexical
order of priorotized global object initializations.
llvm-svn: 106503
Diffstat (limited to 'clang/lib/CodeGen/CGDeclCXX.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDeclCXX.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGDeclCXX.cpp b/clang/lib/CodeGen/CGDeclCXX.cpp index 9faaed55386..c2e2dd0ee48 100644 --- a/clang/lib/CodeGen/CGDeclCXX.cpp +++ b/clang/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 |