[SanitizerBinaryMetadata] Do not add to GPU code
authorMarco Elver <elver@google.com>
Tue, 7 Mar 2023 19:00:12 +0000 (20:00 +0100)
committerMarco Elver <elver@google.com>
Thu, 9 Mar 2023 09:15:28 +0000 (10:15 +0100)
commit61ed64954b979df0d5bfdfbe54a7c27e20be9001
tree1285ba6f160486eaff20e26afb2bfad8f296468f
parent78d91e4452d0085c929eaa7a8dddccf7b077556b
[SanitizerBinaryMetadata] Do not add to GPU code

SanitizerBinaryMetadata should only apply to to host code, and not GPU
code. Recently AMD GPU target code has experimental sanitizer support.

If we're compiling a mixed host/device source file, only add sanitizer
metadata to host code.

Differential Revision: https://reviews.llvm.org/D145519
clang/lib/Driver/SanitizerArgs.cpp
llvm/lib/Transforms/Instrumentation/SanitizerBinaryMetadata.cpp