Files
swift-mirror/include/swift/Basic/Debug.h
Ben Barham 68296c9037 [next] Remove LLVM_ATTRIBUTE_DEPRECATED
`LLVM_ATTRIBUTE_DEPRECATED` was removed in llvm/llvm-project
903c30f4d1f3bc0d1aae9ca83af17c0062d02b40. Use `[[deprecated]]` directly.
2022-05-05 16:25:10 -07:00

39 lines
1.4 KiB
C++

//===--- Debug.h - Compiler debugging helpers -------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_BASIC_DEBUG_H
#define SWIFT_BASIC_DEBUG_H
#include "llvm/Support/Compiler.h"
/// Adds attributes to the provided method signature indicating that it is a
/// debugging helper that should never be called directly from compiler code.
/// This deprecates the method so it won't be called directly and marks it as
/// used so it won't be eliminated as dead code.
#define SWIFT_DEBUG_HELPER(method) \
[[deprecated("only for use in the debugger")]] method LLVM_ATTRIBUTE_USED
/// Declares a const void instance method with the name and parameters provided.
/// Methods declared with this macro should never be called except in the
/// debugger.
#define SWIFT_DEBUG_DUMPER(nameAndParams) \
SWIFT_DEBUG_HELPER(void nameAndParams const)
/// Declares an instance `void dump() const` method. Methods declared with this
/// macro should never be called except in the debugger.
#define SWIFT_DEBUG_DUMP \
SWIFT_DEBUG_DUMPER(dump())
#endif