diff options
author | Julian Lettner <jlettner@apple.com> | 2019-02-02 02:05:16 +0000 |
---|---|---|
committer | Julian Lettner <jlettner@apple.com> | 2019-02-02 02:05:16 +0000 |
commit | f82d8924ef7fe20f786d70ee4634be4d5dc508d3 (patch) | |
tree | 27e2a45bb7f8e863dcb9af6a53d14752c537e38a /clang/lib/CodeGen | |
parent | 7d53675b709232bf94730f7e73bdd791103d5e1a (diff) | |
download | bcm5719-llvm-f82d8924ef7fe20f786d70ee4634be4d5dc508d3.tar.gz bcm5719-llvm-f82d8924ef7fe20f786d70ee4634be4d5dc508d3.zip |
[ASan] Do not instrument other runtime functions with `__asan_handle_no_return`
Summary:
Currently, ASan inserts a call to `__asan_handle_no_return` before every
`noreturn` function call/invoke. This is unnecessary for calls to other
runtime funtions. This patch changes ASan to skip instrumentation for
functions calls marked with `!nosanitize` metadata.
Reviewers: TODO
Differential Revision: https://reviews.llvm.org/D57489
llvm-svn: 352948
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 4051cfb820c..730dac37dd2 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -4394,8 +4394,8 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, // Strip away the noreturn attribute to better diagnose unreachable UB. if (SanOpts.has(SanitizerKind::Unreachable)) { - // Also remove from function since CI->hasFnAttr(..) also checks attributes - // of the called function. + // Also remove from function since CallBase::hasFnAttr additionally checks + // attributes of the called function. if (auto *F = CI->getCalledFunction()) F->removeFnAttr(llvm::Attribute::NoReturn); CI->removeAttribute(llvm::AttributeList::FunctionIndex, |