blob: 737d9ef2434e195c7e90edb9c76d2e8eb4c30e35 [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
9#ifndef liblldb_lldb_private_defines_h_
10#define liblldb_lldb_private_defines_h_
11
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
36#endif // liblldb_lldb_private_defines_h_