summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-03-10 02:19:29 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-03-10 02:19:29 +0000
commite7113ca907daa9f84992986f005e8ca6e6577481 (patch)
treeda4680799639f5060a4cbf70bcfcce709a1f870d /clang/lib/CodeGen/CodeGenModule.cpp
parentb7e0b87441a253be7973b1da9abc07a1c7fa68bd (diff)
downloadbcm5719-llvm-e7113ca907daa9f84992986f005e8ca6e6577481.tar.gz
bcm5719-llvm-e7113ca907daa9f84992986f005e8ca6e6577481.zip
Delay codegen of vtables when handling implicit instantiations.
This fixes PR6474. llvm-svn: 98123
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index d6a56dad0ba..c67948d27f0 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -488,7 +488,15 @@ void CodeGenModule::EmitDeferred() {
// Emit code for any potentially referenced deferred decls. Since a
// previously unused static decl may become used during the generation of code
// for a static function, iterate until no changes are made.
- while (!DeferredDeclsToEmit.empty()) {
+
+ while (!DeferredDeclsToEmit.empty() || !DeferredVtables.empty()) {
+ if (!DeferredVtables.empty()) {
+ const CXXRecordDecl *RD = DeferredVtables.back();
+ DeferredVtables.pop_back();
+ getVtableInfo().GenerateClassData(getVtableLinkage(RD), RD);
+ continue;
+ }
+
GlobalDecl D = DeferredDeclsToEmit.back();
DeferredDeclsToEmit.pop_back();
OpenPOWER on IntegriCloud