aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2012-11-06 22:44:45 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2012-11-06 22:44:45 +0000
commitabed749203dbbd37fc9a5e3030b67fddd2f8e924 (patch)
tree7a671cb2a025f7432302bde723c4ddc727cc679e /clang/lib/CodeGen/CodeGenModule.h
parent8cbca20a59d5fe320ff9764eb4795489e398a410 (diff)
downloadllvm-abed749203dbbd37fc9a5e3030b67fddd2f8e924.zip
llvm-abed749203dbbd37fc9a5e3030b67fddd2f8e924.tar.gz
llvm-abed749203dbbd37fc9a5e3030b67fddd2f8e924.tar.bz2
Implement codegen for init_priority attribute properly - make sure it
works between the modules. No functionality change on Darwin/Windows. This fixes PR11480. llvm-svn: 167496
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index d51a4670..1167c87 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -296,11 +296,18 @@ class CodeGenModule : public CodeGenTypeCache {
/// order.
llvm::DenseMap<const Decl*, unsigned> DelayedCXXInitPosition;
+ typedef std::pair<OrderGlobalInits, llvm::Function*> GlobalInitData;
+
+ struct GlobalInitPriorityCmp {
+ bool operator()(const GlobalInitData &LHS,
+ const GlobalInitData &RHS) const {
+ return LHS.first.priority < RHS.first.priority;
+ }
+ };
+
/// - Global variables with initializers whose order of initialization
/// is set by init_priority attribute.
-
- SmallVector<std::pair<OrderGlobalInits, llvm::Function*>, 8>
- PrioritizedCXXGlobalInits;
+ SmallVector<GlobalInitData, 8> PrioritizedCXXGlobalInits;
/// CXXGlobalDtors - Global destructor functions and arguments that need to
/// run on termination.