OSDN Git Service

[sanitizers] Disable target-specific lowering of string functions.
authorMarcin Koscielnicki <koriakin@0x04.net>
Sat, 18 Jun 2016 10:10:37 +0000 (10:10 +0000)
committerMarcin Koscielnicki <koriakin@0x04.net>
Sat, 18 Jun 2016 10:10:37 +0000 (10:10 +0000)
commitccb3bb979ec6521cd4b8a5fa6e74ab5ff9d4806d
treeca8e9cf828352207bcde78fcf656232726596796
parent5e494bc177502a7e25ff3a8402f43f2aca37a9e6
[sanitizers] Disable target-specific lowering of string functions.

CodeGen has hooks that allow targets to emit specialized code instead
of calls to memcmp, memchr, strcpy, stpcpy, strcmp, strlen, strnlen.
When ASan/MSan/TSan/ESan is in use, this sidesteps its interceptors, resulting
in uninstrumented memory accesses.  To avoid that, make these sanitizers
mark the calls as nobuiltin.

Differential Revision: http://reviews.llvm.org/D19781

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273083 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Utils/Local.h
lib/Transforms/Instrumentation/AddressSanitizer.cpp
lib/Transforms/Instrumentation/EfficiencySanitizer.cpp
lib/Transforms/Instrumentation/MemorySanitizer.cpp
lib/Transforms/Instrumentation/ThreadSanitizer.cpp
lib/Transforms/Utils/Local.cpp
test/Instrumentation/AddressSanitizer/str-nobuiltin.ll [new file with mode: 0644]
test/Instrumentation/EfficiencySanitizer/str-nobuiltin.ll [new file with mode: 0644]
test/Instrumentation/MemorySanitizer/str-nobuiltin.ll [new file with mode: 0644]
test/Instrumentation/ThreadSanitizer/str-nobuiltin.ll [new file with mode: 0644]