Files
swift-mirror/include/swift/SILOptimizer/Utils/RegionIsolation.h
Michael Gottesman b477433a20 [region-isolation] Move the region isolation logging decls out of PartitionUtils.h -> RegionIsolation.h
These do not specifically have to do with PartitionUtils... they are really
logging options for the whole infrastructure, so it makes sense to have them in
the a different file.
2024-08-19 11:28:55 -07:00

62 lines
2.2 KiB
C++

//===--- RegionIsolation.h ------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2024 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
//
//===----------------------------------------------------------------------===//
///
/// \file This file just declares some command line options that are used for
/// the various parts of region analysis based diagnostics.
///
//===----------------------------------------------------------------------===//
#ifndef SWIFT_SILOPTIMIZER_UTILS_REGIONANALYSIS_H
#define SWIFT_SILOPTIMIZER_UTILS_REGIONANALYSIS_H
namespace swift {
namespace regionisolation {
enum class LoggingFlag {
Off = 0,
Normal = 0x1,
Verbose = 0x3,
};
extern LoggingFlag ENABLE_LOGGING;
#ifdef REGIONBASEDISOLATION_LOG
#error "REGIONBASEDISOLATION_LOG already defined?!"
#endif
#ifdef REGIONBASEDISOLATION_VERBOSE_LOG
#error "REGIONBASEDISOLATION_VERBOSE_LOG already defined?!"
#endif
#define REGIONBASEDISOLATION_LOG(...) \
do { \
if (swift::regionisolation::ENABLE_LOGGING != \
swift::regionisolation::LoggingFlag::Off) { \
__VA_ARGS__; \
} \
} while (0);
#define REGIONBASEDISOLATION_VERBOSE_LOG(...) \
do { \
if (swift::regionisolation::ENABLE_LOGGING == \
swift::regionisolation::LoggingFlag::Verbose) { \
__VA_ARGS__; \
} \
} while (0);
} // namespace regionisolation
} // namespace swift
#endif