order of priorotized global object initializations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106503
91177308-0d34-0410-b5e6-
96231b3b80d8
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