blob: 002ecf32a5954a86dc164460dd5729f213e198eb [file] [log] [blame]
Pirama Arumuga Nainar7c915052015-04-08 08:58:29 -07001//===-- ubsan_platform.h ----------------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// Defines the platforms which UBSan is supported at.
11//
12//===----------------------------------------------------------------------===//
13#ifndef UBSAN_PLATFORM_H
14#define UBSAN_PLATFORM_H
15
16// Other platforms should be easy to add, and probably work as-is.
17#if (defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)) && \
18 (defined(__x86_64__) || defined(__i386__) || defined(__arm__) || \
Pirama Arumuga Nainar259f7062015-05-06 11:49:53 -070019 defined(__aarch64__) || defined(__mips__) || defined(__powerpc64__))
Pirama Arumuga Nainar7c915052015-04-08 08:58:29 -070020# define CAN_SANITIZE_UB 1
Pirama Arumuga Nainar799172d2016-03-03 15:50:30 -080021#elif defined(_WIN32)
22# define CAN_SANITIZE_UB 1
Pirama Arumuga Nainar7c915052015-04-08 08:58:29 -070023#else
24# define CAN_SANITIZE_UB 0
Pirama Arumuga Nainar7c915052015-04-08 08:58:29 -070025#endif
26
27#endif