Alexey Samsonov | 0781e98 | 2015-03-26 17:26:04 +0000 | [diff] [blame] | 1 | //===-- 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. |
Kamil Rytarowski | 7cde467 | 2018-02-17 13:35:09 +0000 | [diff] [blame] | 17 | #if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) || \ |
Kamil Rytarowski | 4410bbc | 2018-03-02 07:30:22 +0000 | [diff] [blame] | 18 | defined(__NetBSD__) || defined(__OpenBSD__) || \ |
| 19 | (defined(__sun__) && defined(__svr4__)) || \ |
Walter Lee | b134dbb | 2018-05-18 00:43:54 +0000 | [diff] [blame] | 20 | defined(_WIN32) || defined(__Fuchsia__) || defined(__rtems__) |
Peter Collingbourne | d3b9917 | 2015-07-02 01:44:34 +0000 | [diff] [blame] | 21 | # define CAN_SANITIZE_UB 1 |
Alexey Samsonov | 0781e98 | 2015-03-26 17:26:04 +0000 | [diff] [blame] | 22 | #else |
| 23 | # define CAN_SANITIZE_UB 0 |
Alexey Samsonov | 0781e98 | 2015-03-26 17:26:04 +0000 | [diff] [blame] | 24 | #endif |
| 25 | |
| 26 | #endif |