summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCXXABI.h
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2017-12-13 21:53:04 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2017-12-13 21:53:04 +0000
commit6010880bd13b11ea687658d8f5bc4913bc62eb27 (patch)
treeb65f59e8515805d5b1301f1a443568677ff4f897 /clang/lib/CodeGen/CGCXXABI.h
parent14318c5b318cd90123029fd1622dfcd024caeff4 (diff)
downloadbcm5719-llvm-6010880bd13b11ea687658d8f5bc4913bc62eb27.tar.gz
bcm5719-llvm-6010880bd13b11ea687658d8f5bc4913bc62eb27.zip
IRGen: When performing CFI checks, load vtable pointer from vbase when necessary.
Under the Microsoft ABI, it is possible for an object not to have a virtual table pointer of its own if all of its virtual functions were introduced by virtual bases. In that case, we need to load the vtable pointer from one of the virtual bases and perform the type check using its type. Differential Revision: https://reviews.llvm.org/D41036 llvm-svn: 320638
Diffstat (limited to 'clang/lib/CodeGen/CGCXXABI.h')
-rw-r--r--clang/lib/CodeGen/CGCXXABI.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCXXABI.h b/clang/lib/CodeGen/CGCXXABI.h
index ed5771d2ca4..83426dc3a03 100644
--- a/clang/lib/CodeGen/CGCXXABI.h
+++ b/clang/lib/CodeGen/CGCXXABI.h
@@ -582,6 +582,13 @@ public:
/// Emit a single constructor/destructor with the given type from a C++
/// constructor Decl.
virtual void emitCXXStructor(const CXXMethodDecl *MD, StructorType Type) = 0;
+
+ /// Load a vtable from This, an object of polymorphic type RD, or from one of
+ /// its virtual bases if it does not have its own vtable. Returns the vtable
+ /// and the class from which the vtable was loaded.
+ virtual std::pair<llvm::Value *, const CXXRecordDecl *>
+ LoadVTablePtr(CodeGenFunction &CGF, Address This,
+ const CXXRecordDecl *RD) = 0;
};
// Create an instance of a C++ ABI class:
OpenPOWER on IntegriCloud