1287516Sdim//===-- ubsan_platform.h ----------------------------------------*- C++ -*-===// 2287516Sdim// 3287516Sdim// The LLVM Compiler Infrastructure 4287516Sdim// 5287516Sdim// This file is distributed under the University of Illinois Open Source 6287516Sdim// License. See LICENSE.TXT for details. 7287516Sdim// 8287516Sdim//===----------------------------------------------------------------------===// 9287516Sdim// 10287516Sdim// Defines the platforms which UBSan is supported at. 11287516Sdim// 12287516Sdim//===----------------------------------------------------------------------===// 13287516Sdim#ifndef UBSAN_PLATFORM_H 14287516Sdim#define UBSAN_PLATFORM_H 15287516Sdim 16287516Sdim// Other platforms should be easy to add, and probably work as-is. 17287516Sdim#if (defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)) && \ 18287516Sdim (defined(__x86_64__) || defined(__i386__) || defined(__arm__) || \ 19287516Sdim defined(__aarch64__) || defined(__mips__) || defined(__powerpc64__)) 20287516Sdim# define CAN_SANITIZE_UB 1 21287516Sdim#elif defined(_WIN32) 22287516Sdim# define CAN_SANITIZE_UB 1 23287516Sdim#else 24287516Sdim# define CAN_SANITIZE_UB 0 25287516Sdim#endif 26287516Sdim 27287516Sdim#endif 28