aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGVtable.cpp
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-11-10 19:13:04 +0000
committerMike Stump <mrs@apple.com>2009-11-10 19:13:04 +0000
commitf1c03338def80031dfea27a2e32624a794c0a187 (patch)
tree2188c570f3635c437d0173566297fac23a7343bf /lib/CodeGen/CGVtable.cpp
parent8fa01c8f98ff7c8f40fee5014c9c393d806381a4 (diff)
Only generate a VTT for classes that need a VTT.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86699 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r--lib/CodeGen/CGVtable.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp
index 3799695b90..636639d05e 100644
--- a/lib/CodeGen/CGVtable.cpp
+++ b/lib/CodeGen/CGVtable.cpp
@@ -733,6 +733,10 @@ public:
};
llvm::Constant *CodeGenModule::GenerateVTT(const CXXRecordDecl *RD) {
+ // Only classes that have virtual bases need a VTT.
+ if (RD->getNumVBases() == 0)
+ return 0;
+
llvm::SmallString<256> OutName;
llvm::raw_svector_ostream Out(OutName);
mangleCXXVTT(getMangleContext(), RD, Out);