summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2015-04-15 01:08:06 +0000
committerReid Kleckner <reid@kleckner.net>2015-04-15 01:08:06 +0000
commite07140eb3fb5b2d3df2f57cccc633a0d1e21c6f2 (patch)
tree7ae34ebf92346ca97b9df63beff0cac6f606dd98 /clang/lib/CodeGen/CodeGenModule.h
parent58927f1aa2e37854b5ff728eedda8ec8aff779be (diff)
downloadbcm5719-llvm-e07140eb3fb5b2d3df2f57cccc633a0d1e21c6f2.tar.gz
bcm5719-llvm-e07140eb3fb5b2d3df2f57cccc633a0d1e21c6f2.zip
Move the logic to avoid double global emission from Sema to CodeGen
Reverts the code changes from r234675 but keeps the test case. We were already maintaining a DenseMap of globals with dynamic initializers anyway. Fixes the test case from PR23234. llvm-svn: 234961
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index e5e52b5e7ba..feef6c2583e 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -400,7 +400,8 @@ private:
/// When a C++ decl with an initializer is deferred, null is
/// appended to CXXGlobalInits, and the index of that null is placed
/// here so that the initializer will be performed in the correct
- /// order.
+ /// order. Once the decl is emitted, the index is replaced with ~0U to ensure
+ /// that we don't re-emit the initializer.
llvm::DenseMap<const Decl*, unsigned> DelayedCXXInitPosition;
typedef std::pair<OrderGlobalInits, llvm::Function*> GlobalInitData;
OpenPOWER on IntegriCloud