summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorWill Dietz <wdietz2@illinois.edu>2012-12-02 19:50:33 +0000
committerWill Dietz <wdietz2@illinois.edu>2012-12-02 19:50:33 +0000
commit88e0233ff40b565903ad642cfb0e9f90a700534a (patch)
treec7003d6e0800861a6ac329cd1c317ff8d13b7314 /clang/lib/CodeGen/CodeGenFunction.h
parent2c36c71f5b5daae99f173aea32ef34497a7a4a48 (diff)
downloadbcm5719-llvm-88e0233ff40b565903ad642cfb0e9f90a700534a.tar.gz
bcm5719-llvm-88e0233ff40b565903ad642cfb0e9f90a700534a.zip
[ubsan] Add flag to enable recovery from checks when possible.
llvm-svn: 169114
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index f2ab226ab53..ff3c7374213 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -2575,13 +2575,23 @@ public:
/// passing to a runtime sanitizer handler.
llvm::Constant *EmitCheckSourceLocation(SourceLocation Loc);
+ /// \brief Specify under what conditions this check can be recovered
+ enum CheckRecoverableKind {
+ /// Always terminate program execution if this check fails
+ CRK_Unrecoverable,
+ /// Check supports recovering, allows user to specify which
+ CRK_Recoverable,
+ /// Runtime conditionally aborts, always need to support recovery.
+ CRK_AlwaysRecoverable
+ };
+
/// \brief Create a basic block that will call a handler function in a
/// sanitizer runtime with the provided arguments, and create a conditional
/// branch to it.
void EmitCheck(llvm::Value *Checked, StringRef CheckName,
llvm::ArrayRef<llvm::Constant *> StaticArgs,
llvm::ArrayRef<llvm::Value *> DynamicArgs,
- bool Recoverable = false);
+ CheckRecoverableKind Recoverable);
/// \brief Create a basic block that will call the trap intrinsic, and emit a
/// conditional branch to it, for the -ftrapv checks.
OpenPOWER on IntegriCloud