diff options
author | Piotr Padlewski <prazek@google.com> | 2015-09-09 22:20:28 +0000 |
---|---|---|
committer | Piotr Padlewski <prazek@google.com> | 2015-09-09 22:20:28 +0000 |
commit | 982bb7d966947812d216489b3c519c9825cacbf2 (patch) | |
tree | a5f1d33eaeba73405bac45876d93625415f38b5c /lib/CodeGen/CGCXXABI.h | |
parent | 1694b9d193ea9f50314856b0f2d769ba20e92778 (diff) | |
download | clang-982bb7d966947812d216489b3c519c9825cacbf2.tar.gz |
Generating assumption loads of vptr after ctor call (fixed)
Generating call assume(icmp %vtable, %global_vtable) after constructor
call for devirtualization purposes.
For more info go to:
http://lists.llvm.org/pipermail/cfe-dev/2015-July/044227.html
Edit:
Fixed version because of PR24479.
After this patch got reverted because of ScalarEvolution bug (D12719)
Merged after John McCall big patch (Added Address).
http://reviews.llvm.org/D11859
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247199 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCXXABI.h')
-rw-r--r-- | lib/CodeGen/CGCXXABI.h | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/lib/CodeGen/CGCXXABI.h b/lib/CodeGen/CGCXXABI.h index 828c9ecfc6..fb878e753f 100644 --- a/lib/CodeGen/CGCXXABI.h +++ b/lib/CodeGen/CGCXXABI.h @@ -228,8 +228,10 @@ public: virtual void emitThrow(CodeGenFunction &CGF, const CXXThrowExpr *E) = 0; virtual llvm::GlobalVariable *getThrowInfo(QualType T) { return nullptr; } - virtual bool canEmitAvailableExternallyVTable( - const CXXRecordDecl *RD) const = 0; + /// \brief Determine whether it's possible to emit a vtable for \p RD, even + /// though we do not know that the vtable has been marked as used by semantic + /// analysis. + virtual bool canSpeculativelyEmitVTable(const CXXRecordDecl *RD) const = 0; virtual void emitBeginCatch(CodeGenFunction &CGF, const CXXCatchStmt *C) = 0; @@ -355,13 +357,25 @@ public: virtual void emitVTableDefinitions(CodeGenVTables &CGVT, const CXXRecordDecl *RD) = 0; + /// Checks if ABI requires extra virtual offset for vtable field. + virtual bool + isVirtualOffsetNeededForVTableField(CodeGenFunction &CGF, + CodeGenFunction::VPtr Vptr) = 0; + + /// Checks if ABI requires to initilize vptrs for given dynamic class. + virtual bool doStructorsInitializeVPtrs(const CXXRecordDecl *VTableClass) = 0; + + /// Get the address point of the vtable for the given base subobject. + virtual llvm::Constant * + getVTableAddressPoint(BaseSubobject Base, + const CXXRecordDecl *VTableClass) = 0; + /// Get the address point of the vtable for the given base subobject while - /// building a constructor or a destructor. On return, NeedsVirtualOffset - /// tells if a virtual base adjustment is needed in order to get the offset - /// of the base subobject. - virtual llvm::Value *getVTableAddressPointInStructor( - CodeGenFunction &CGF, const CXXRecordDecl *RD, BaseSubobject Base, - const CXXRecordDecl *NearestVBase, bool &NeedsVirtualOffset) = 0; + /// building a constructor or a destructor. + virtual llvm::Value * + getVTableAddressPointInStructor(CodeGenFunction &CGF, const CXXRecordDecl *RD, + BaseSubobject Base, + const CXXRecordDecl *NearestVBase) = 0; /// Get the address point of the vtable for the given base subobject while /// building a constexpr. |