Propagate SanitizerKind into CodeGenFunction::EmitCheck() call.
Make sure CodeGenFunction::EmitCheck() knows which sanitizer
it emits check for. Make CheckRecoverableKind enum an
implementation detail and move it away from header.
Currently CheckRecoverableKind is determined by the type of
sanitizer ("unreachable" and "return" are unrecoverable,
"vptr" is always-recoverable, all the rest are recoverable).
This will change in future if we allow to specify which sanitizers
are recoverable, and which are not by -fsanitize-recover= flag.
No functionality change.
llvm-svn: 221635
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 6f2a27f..ca5db85 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -2300,7 +2300,8 @@
EmitCheckSourceLocation(EndLoc),
EmitCheckSourceLocation(RetNNAttr->getLocation()),
};
- EmitCheck(Cond, "nonnull_return", StaticData, None, CRK_Recoverable);
+ EmitCheck(Cond, "nonnull_return", StaticData, None,
+ SanitizerKind::ReturnsNonnullAttribute);
}
}
Ret = Builder.CreateRet(RV);
@@ -2636,7 +2637,7 @@
llvm::ConstantInt::get(CGF.Int32Ty, ArgNo + 1),
};
CGF.EmitCheck(Cond, "nonnull_arg", StaticData, None,
- CodeGenFunction::CRK_Recoverable);
+ SanitizerKind::NonnullAttribute);
}
void CodeGenFunction::EmitCallArgs(CallArgList &Args,