summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 81bff667fb9..d1d67a11b8a 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -424,9 +424,11 @@ void CodeGenModule::EmitDeferred() {
EmitGlobalDefinition(D);
}
- // Emit any tentative definitions.
- for (std::vector<const VarDecl*>::iterator it = TentativeDefinitions.begin(),
- ie = TentativeDefinitions.end(); it != ie; ++it)
+ // Emit any tentative definitions, in reverse order so the most
+ // important (merged) decl will be seen and emitted first.
+ for (std::vector<const VarDecl*>::reverse_iterator
+ it = TentativeDefinitions.rbegin(), ie = TentativeDefinitions.rend();
+ it != ie; ++it)
EmitTentativeDefinition(*it);
}
OpenPOWER on IntegriCloud