lldb-private-defines.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //===-- 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. #ifndef LLDB_LLDB_PRIVATE_DEFINES_H
  9. #define LLDB_LLDB_PRIVATE_DEFINES_H
  10. #if defined(__cplusplus)
  11. // Include Compiler.h here so we don't define LLVM_FALLTHROUGH and then
  12. // Compiler.h later tries to redefine it.
  13. #include "llvm/Support/Compiler.h"
  14. #ifndef LLVM_FALLTHROUGH
  15. #ifndef __has_cpp_attribute
  16. #define __has_cpp_attribute(x) 0
  17. #endif
  18. /// \macro LLVM_FALLTHROUGH
  19. /// Marks an empty statement preceding a deliberate switch fallthrough.
  20. #if __has_cpp_attribute(clang::fallthrough)
  21. #define LLVM_FALLTHROUGH [[clang::fallthrough]]
  22. #else
  23. #define LLVM_FALLTHROUGH
  24. #endif
  25. #endif // ifndef LLVM_FALLTHROUGH
  26. #endif // #if defined(__cplusplus)
  27. #endif // LLDB_LLDB_PRIVATE_DEFINES_H