2017-09-26 Richard Biener <rguenther@suse.de>
[official-gcc.git] / libsanitizer / ubsan / ubsan_platform.h
blobfa4e1a191aa379f89b10ec74b5cec581173b68a5
1 //===-- ubsan_platform.h ----------------------------------------*- C++ -*-===//
2 //
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
5 //
6 //===----------------------------------------------------------------------===//
7 //
8 // Defines the platforms which UBSan is supported at.
9 //
10 //===----------------------------------------------------------------------===//
11 #ifndef UBSAN_PLATFORM_H
12 #define UBSAN_PLATFORM_H
14 #ifndef CAN_SANITIZE_UB
15 // Other platforms should be easy to add, and probably work as-is.
16 #if (defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)) && \
17 (defined(__x86_64__) || defined(__i386__) || defined(__arm__) || \
18 defined(__aarch64__) || defined(__mips__) || defined(__powerpc64__) || \
19 defined(__s390__))
20 # define CAN_SANITIZE_UB 1
21 #elif defined(_WIN32)
22 # define CAN_SANITIZE_UB 1
23 #else
24 # define CAN_SANITIZE_UB 0
25 #endif
26 #endif //CAN_SANITIZE_UB
28 #endif