aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprCXX.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-09-08 02:08:36 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-09-08 02:08:36 +0000
commit7ac9ef1c82c779a5348ed11b3d10e01c58803b35 (patch)
tree75bafb315db7d2fb2f554e867ea52fb01cb7ae4f /lib/CodeGen/CGExprCXX.cpp
parent82f2ad456a82da1b9cb7ddfc994c8f5fa44b59e6 (diff)
-fcatch-undefined-behavior: Factor emission of the creation of, and branch to,
the trap BB out of the individual checks and into a common function, to prepare for making this code call into a runtime library. Rename the existing EmitCheck to EmitTypeCheck to clarify it and to move it out of the way of the new EmitCheck. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163451 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprCXX.cpp')
-rw-r--r--lib/CodeGen/CGExprCXX.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp
index 17e2bc1874..b4cd5c1c16 100644
--- a/lib/CodeGen/CGExprCXX.cpp
+++ b/lib/CodeGen/CGExprCXX.cpp
@@ -36,7 +36,8 @@ RValue CodeGenFunction::EmitCXXMemberCall(const CXXMethodDecl *MD,
// C++11 [class.mfct.non-static]p2:
// If a non-static member function of a class X is called for an object that
// is not of type X, or of a type derived from X, the behavior is undefined.
- EmitCheck(CT_MemberCall, This, getContext().getRecordType(MD->getParent()));
+ EmitTypeCheck(TCK_MemberCall, This,
+ getContext().getRecordType(MD->getParent()));
CallArgList Args;
@@ -342,7 +343,7 @@ CodeGenFunction::EmitCXXMemberPointerCallExpr(const CXXMemberCallExpr *E,
else
This = EmitLValue(BaseExpr).getAddress();
- EmitCheck(CT_MemberCall, This, QualType(MPT->getClass(), 0));
+ EmitTypeCheck(TCK_MemberCall, This, QualType(MPT->getClass(), 0));
// Ask the ABI to load the callee. Note that This is modified.
llvm::Value *Callee =