mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
46728cef44
And for now let's place C++ interop crashers in a separate directory.
44 lines
1.2 KiB
Swift
44 lines
1.2 KiB
Swift
//===--- OutputDirs.swift -------------------------------------------------===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2026 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
public struct OutputDirs {
|
|
public var main: AbsolutePath
|
|
public var ideCrashers: AbsolutePath
|
|
public var cxxCrashers: AbsolutePath
|
|
|
|
public init(
|
|
main: AbsolutePath,
|
|
ideCrashers: AbsolutePath,
|
|
cxxCrashers: AbsolutePath,
|
|
) {
|
|
self.main = main
|
|
self.ideCrashers = ideCrashers
|
|
self.cxxCrashers = cxxCrashers
|
|
}
|
|
|
|
var allPaths: [AbsolutePath] {
|
|
Set([main, ideCrashers, cxxCrashers]).sorted(by: \.rawPath)
|
|
}
|
|
|
|
func outputDir(for reproducer: Reproducer) -> AbsolutePath {
|
|
if reproducer.kind == .complete {
|
|
return ideCrashers
|
|
}
|
|
if reproducer.options.extraArgs.contains(where: {
|
|
$0.value?.starts(with: "-cxx-interoperability-mode") ?? false
|
|
}) {
|
|
return cxxCrashers
|
|
}
|
|
return main
|
|
}
|
|
}
|