blob: d66e6ef1518d7c7d7f4f6b19af5cf573ba111238 [file] [log] [blame]
Andrew Walbran3d2c1972020-04-07 12:24:26 +01001//===-- lldb-private-defines.h ----------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
Olivier Deprezf4ef2d02021-04-20 13:36:24 +02009#ifndef LLDB_LLDB_PRIVATE_DEFINES_H
10#define LLDB_LLDB_PRIVATE_DEFINES_H
Andrew Walbran3d2c1972020-04-07 12:24:26 +010011
12#if defined(__cplusplus)
13
14// Include Compiler.h here so we don't define LLVM_FALLTHROUGH and then
15// Compiler.h later tries to redefine it.
16#include "llvm/Support/Compiler.h"
17
18#ifndef LLVM_FALLTHROUGH
19
20#ifndef __has_cpp_attribute
21#define __has_cpp_attribute(x) 0
22#endif
23
24/// \macro LLVM_FALLTHROUGH
25/// Marks an empty statement preceding a deliberate switch fallthrough.
26#if __has_cpp_attribute(clang::fallthrough)
27#define LLVM_FALLTHROUGH [[clang::fallthrough]]
28#else
29#define LLVM_FALLTHROUGH
30#endif
31
32#endif // ifndef LLVM_FALLTHROUGH
33
34#endif // #if defined(__cplusplus)
35
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020036#endif // LLDB_LLDB_PRIVATE_DEFINES_H