1 //===-- ubsan_platform.h ----------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Defines the platforms which UBSan is supported at.
12 //===----------------------------------------------------------------------===//
13 #ifndef UBSAN_PLATFORM_H
14 #define UBSAN_PLATFORM_H
16 // Other platforms should be easy to add, and probably work as-is.
17 #if (defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) || \
18 defined(__NetBSD__)) && \
19 (defined(__x86_64__) || defined(__i386__) || defined(__arm__) || \
20 defined(__aarch64__) || defined(__mips__) || defined(__powerpc64__) || \
21 defined(__s390__)) || (defined(__sun__) && defined(__svr4__))
22 # define CAN_SANITIZE_UB 1
23 #elif defined(_WIN32) || defined(__Fuchsia__)
24 # define CAN_SANITIZE_UB 1
26 # define CAN_SANITIZE_UB 0