aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGVtable.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-01-17 23:53:20 +0000
committerAnders Carlsson <andersca@mac.com>2010-01-17 23:53:20 +0000
commitd478cc7c1cd737c3033b96a883f619f0b1beaf24 (patch)
tree32139cd9a55eaca9b50228f64405128a6a017de1 /lib/CodeGen/CGVtable.cpp
parente74f3d07f075914dd250cadca24dd708916b4d55 (diff)
Minor VTT builder cleanup, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93696 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r--lib/CodeGen/CGVtable.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp
index 27cb661292..d72c32ac44 100644
--- a/lib/CodeGen/CGVtable.cpp
+++ b/lib/CodeGen/CGVtable.cpp
@@ -1266,6 +1266,9 @@ class VTTBuilder {
const CXXRecordDecl *VtableClass,
const CXXRecordDecl *RD,
uint64_t Offset) {
+ if (!GenerateDefinition)
+ return 0;
+
uint64_t AddressPoint;
if (VtableClass != Class) {
@@ -1330,17 +1333,14 @@ class VTTBuilder {
// FIXME: Slightly too many of these for __ZTT8test8_B2
llvm::Constant *init;
if (BaseMorallyVirtual)
- init = GenerateDefinition ?
- BuildVtablePtr(vtbl, VtblClass, RD, Offset) : 0;
+ init = BuildVtablePtr(vtbl, VtblClass, RD, Offset);
else {
- init = GenerateDefinition ?
- getCtorVtable(BaseSubobject(Base, BaseOffset)) : 0;
+ init = getCtorVtable(BaseSubobject(Base, BaseOffset));
subvtbl = init;
subVtblClass = Base;
- init = GenerateDefinition ?
- BuildVtablePtr(init, Class, Base, BaseOffset) : 0;
+ init = BuildVtablePtr(init, Class, Base, BaseOffset);
}
Inits.push_back(init);
}
@@ -1359,16 +1359,14 @@ class VTTBuilder {
// First comes the primary virtual table pointer...
if (MorallyVirtual) {
- Vtable = GenerateDefinition ? ClassVtbl : 0;
+ Vtable = ClassVtbl;
VtableClass = Class;
} else {
- Vtable = GenerateDefinition ?
- getCtorVtable(BaseSubobject(RD, Offset)) : 0;
+ Vtable = getCtorVtable(BaseSubobject(RD, Offset));
VtableClass = RD;
}
- llvm::Constant *Init = GenerateDefinition ?
- BuildVtablePtr(Vtable, VtableClass, RD, Offset) : 0;
+ llvm::Constant *Init = BuildVtablePtr(Vtable, VtableClass, RD, Offset);
Inits.push_back(Init);
// then the secondary VTTs....
@@ -1428,9 +1426,9 @@ public:
GenerateDefinition(GenerateDefinition) {
// First comes the primary virtual table pointer for the complete class...
- ClassVtbl = CGM.getVtableInfo().getVtable(Class);
- llvm::Constant *Init = GenerateDefinition ?
- BuildVtablePtr(ClassVtbl, Class, Class, 0) : 0;
+ ClassVtbl = GenerateDefinition ? CGM.getVtableInfo().getVtable(Class) : 0;
+
+ llvm::Constant *Init = BuildVtablePtr(ClassVtbl, Class, Class, 0);
Inits.push_back(Init);
// then the secondary VTTs...