[ASan] Do not instrument other runtime functions with `__asan_handle_no_return`
commitcb8d1d7cc8c8ae9cc5ed6692f9e117a96d4c03fc
authorJulian Lettner <jlettner@apple.com>
Sat, 2 Feb 2019 02:05:16 +0000 (2 02:05 +0000)
committerJulian Lettner <jlettner@apple.com>
Sat, 2 Feb 2019 02:05:16 +0000 (2 02:05 +0000)
treea2febb53056af7a9a00f94a9a8c4f17159424f8a
parent588aa70961102c468c2b182e6b8af0726b2e80c9
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352948 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Instrumentation/AddressSanitizer.cpp
test/Instrumentation/AddressSanitizer/instrument-no-return.ll