aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-06-25 00:24:06 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-06-25 00:24:06 +0000
commit0ca0363d052425c5788aafeafe6030264c25cdb2 (patch)
tree9757cda2bd9fac594e1ea0f5136774d49cd9c8d1 /clang/lib/CodeGen/CodeGenFunction.h
parent0312f614b1bfdad55c1832ee37d6d4b738ea70cf (diff)
downloadllvm-0ca0363d052425c5788aafeafe6030264c25cdb2.zip
llvm-0ca0363d052425c5788aafeafe6030264c25cdb2.tar.gz
llvm-0ca0363d052425c5788aafeafe6030264c25cdb2.tar.bz2
CodeGen: Start emitting checked loads when both trapping CFI and -fwhole-program-vtables are enabled.
Differential Revision: http://reviews.llvm.org/D21122 llvm-svn: 273757
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 28ee621..08051e8 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -1423,6 +1423,15 @@ public:
void EmitTypeMetadataCodeForVCall(const CXXRecordDecl *RD,
llvm::Value *VTable, SourceLocation Loc);
+ /// Returns whether we should perform a type checked load when loading a
+ /// virtual function for virtual calls to members of RD. This is generally
+ /// true when both vcall CFI and whole-program-vtables are enabled.
+ bool ShouldEmitVTableTypeCheckedLoad(const CXXRecordDecl *RD);
+
+ /// Emit a type checked load from the given vtable.
+ llvm::Value *EmitVTableTypeCheckedLoad(const CXXRecordDecl *RD, llvm::Value *VTable,
+ uint64_t VTableByteOffset);
+
/// CanDevirtualizeMemberFunctionCalls - Checks whether virtual calls on given
/// expr can be devirtualized.
bool CanDevirtualizeMemberFunctionCall(const Expr *Base,