summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-11-30 23:41:22 +0000
committerAnders Carlsson <andersca@mac.com>2009-11-30 23:41:22 +0000
commitb1d3f7c909843b71a950a66debab300c155636d3 (patch)
treef220608d2460efc97bf3dcb519b8a81fc507424b /clang/lib/CodeGen/CodeGenModule.cpp
parent3ee8bc9b358dbcdd43cf37a50c032deaadbce922 (diff)
downloadbcm5719-llvm-b1d3f7c909843b71a950a66debab300c155636d3.tar.gz
bcm5719-llvm-b1d3f7c909843b71a950a66debab300c155636d3.zip
Have ASTRecordLayout keep track of the key function, in preparation of fixing a synthetic ctor/dtor bug.
llvm-svn: 90168
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index a14733aba02..4b3b122b71c 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -21,6 +21,7 @@
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclCXX.h"
+#include "clang/AST/RecordLayout.h"
#include "clang/Basic/Builtins.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/SourceManager.h"
@@ -614,18 +615,9 @@ void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD) {
Context.getSourceManager(),
"Generating code for declaration");
- if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(D)) {
- const CXXRecordDecl *RD = MD->getParent();
- // We have to convert it to have a record layout.
- Types.ConvertTagDeclType(RD);
- const CGRecordLayout &CGLayout = Types.getCGRecordLayout(RD);
- // A definition of a KeyFunction, generates all the class data, such
- // as vtable, rtti and the VTT.
- if (CGLayout.getKeyFunction()
- && (CGLayout.getKeyFunction()->getCanonicalDecl()
- == MD->getCanonicalDecl()))
- getVtableInfo().GenerateClassData(RD);
- }
+ if (isa<CXXMethodDecl>(D))
+ getVtableInfo().MaybeEmitVtable(GD);
+
if (const CXXConstructorDecl *CD = dyn_cast<CXXConstructorDecl>(D))
EmitCXXConstructor(CD, GD.getCtorType());
else if (const CXXDestructorDecl *DD = dyn_cast<CXXDestructorDecl>(D))
OpenPOWER on IntegriCloud