diff options
author | Anders Carlsson <andersca@mac.com> | 2010-01-17 23:53:20 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-01-17 23:53:20 +0000 |
commit | 827b245fd6a5df44a32f5001a24dd3850c795022 (patch) | |
tree | ff533052a488fd9b99e64fbdbf2e9f9f52dc4a73 /clang/lib/CodeGen | |
parent | 8b5d55ed065cb070540b7be09a67181206fdd58e (diff) | |
download | bcm5719-llvm-827b245fd6a5df44a32f5001a24dd3850c795022.tar.gz bcm5719-llvm-827b245fd6a5df44a32f5001a24dd3850c795022.zip |
Minor VTT builder cleanup, no functionality change.
llvm-svn: 93696
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGVtable.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/clang/lib/CodeGen/CGVtable.cpp b/clang/lib/CodeGen/CGVtable.cpp index 27cb6612928..d72c32ac449 100644 --- a/clang/lib/CodeGen/CGVtable.cpp +++ b/clang/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... |