From 3fd8f0a008f63830b2b7c5c1550ecd2b1a66823b Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Fri, 4 Apr 2025 07:49:08 +0100 Subject: [PATCH] [NFC] Sema: Factor out derived conformance sources into subdirectory --- lib/Sema/AssociatedTypeInference.cpp | 9 +++---- lib/Sema/CMakeLists.txt | 24 +++++++++---------- lib/Sema/CodeSynthesis.cpp | 4 ++-- lib/Sema/CodeSynthesisDistributedActor.cpp | 2 +- .../DerivedConformance.cpp} | 12 +++++----- .../DerivedConformance.h} | 10 ++++---- .../DerivedConformanceActor.cpp | 6 ++--- .../DerivedConformanceAdditiveArithmetic.cpp | 6 ++--- .../DerivedConformanceCaseIterable.cpp | 11 +++++---- .../DerivedConformanceCodable.cpp | 8 +++---- .../DerivedConformanceCodingKey.cpp | 6 ++--- .../DerivedConformanceComparable.cpp | 13 +++++----- .../DerivedConformanceDifferentiable.cpp | 10 ++++---- .../DerivedConformanceDistributedActor.cpp | 6 ++--- .../DerivedConformanceEquatableHashable.cpp | 12 +++++----- .../DerivedConformanceError.cpp | 10 ++++---- .../DerivedConformanceRawRepresentable.cpp | 6 ++--- lib/Sema/TypeCheckDecl.cpp | 4 ++-- lib/Sema/TypeCheckDeclPrimary.cpp | 4 ++-- lib/Sema/TypeCheckProtocol.cpp | 4 ++-- 20 files changed, 85 insertions(+), 82 deletions(-) rename lib/Sema/{DerivedConformances.cpp => DerivedConformance/DerivedConformance.cpp} (99%) rename lib/Sema/{DerivedConformances.h => DerivedConformance/DerivedConformance.h} (98%) rename lib/Sema/{ => DerivedConformance}/DerivedConformanceActor.cpp (98%) rename lib/Sema/{ => DerivedConformance}/DerivedConformanceAdditiveArithmetic.cpp (99%) rename lib/Sema/{ => DerivedConformance}/DerivedConformanceCaseIterable.cpp (92%) rename lib/Sema/{ => DerivedConformance}/DerivedConformanceCodable.cpp (99%) rename lib/Sema/{ => DerivedConformance}/DerivedConformanceCodingKey.cpp (99%) rename lib/Sema/{ => DerivedConformance}/DerivedConformanceComparable.cpp (98%) rename lib/Sema/{ => DerivedConformance}/DerivedConformanceDifferentiable.cpp (99%) rename lib/Sema/{ => DerivedConformance}/DerivedConformanceDistributedActor.cpp (99%) rename lib/Sema/{ => DerivedConformance}/DerivedConformanceEquatableHashable.cpp (99%) rename lib/Sema/{ => DerivedConformance}/DerivedConformanceError.cpp (96%) rename lib/Sema/{ => DerivedConformance}/DerivedConformanceRawRepresentable.cpp (99%) diff --git a/lib/Sema/AssociatedTypeInference.cpp b/lib/Sema/AssociatedTypeInference.cpp index 53c129f119632..724e53bf61893 100644 --- a/lib/Sema/AssociatedTypeInference.cpp +++ b/lib/Sema/AssociatedTypeInference.cpp @@ -2,7 +2,7 @@ // // This source file is part of the Swift.org open source project // -// Copyright (c) 2014 - 2024 Apple Inc. and the Swift project authors +// Copyright (c) 2014 - 2025 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 @@ -30,12 +30,13 @@ // a global conformance lookup. // //===----------------------------------------------------------------------===// -#include "TypeCheckProtocol.h" -#include "DerivedConformances.h" + +#include "DerivedConformance/DerivedConformance.h" #include "TypeAccessScopeChecker.h" -#include "TypeChecker.h" #include "TypeCheckAvailability.h" +#include "TypeCheckProtocol.h" #include "TypeCheckType.h" +#include "TypeChecker.h" #include "swift/AST/AvailabilityInference.h" #include "swift/AST/ConformanceLookup.h" diff --git a/lib/Sema/CMakeLists.txt b/lib/Sema/CMakeLists.txt index 103435fa20d90..3973d6fa29eed 100644 --- a/lib/Sema/CMakeLists.txt +++ b/lib/Sema/CMakeLists.txt @@ -24,18 +24,18 @@ add_swift_host_library(swiftSema STATIC ConstraintSystem.cpp CompletionContextFinder.cpp DebuggerTestingTransform.cpp - DerivedConformanceActor.cpp - DerivedConformanceDistributedActor.cpp - DerivedConformanceAdditiveArithmetic.cpp - DerivedConformanceCaseIterable.cpp - DerivedConformanceCodable.cpp - DerivedConformanceCodingKey.cpp - DerivedConformanceDifferentiable.cpp - DerivedConformanceEquatableHashable.cpp - DerivedConformanceComparable.cpp - DerivedConformanceError.cpp - DerivedConformanceRawRepresentable.cpp - DerivedConformances.cpp + DerivedConformance/DerivedConformance.cpp + DerivedConformance/DerivedConformanceActor.cpp + DerivedConformance/DerivedConformanceAdditiveArithmetic.cpp + DerivedConformance/DerivedConformanceCaseIterable.cpp + DerivedConformance/DerivedConformanceCodable.cpp + DerivedConformance/DerivedConformanceCodingKey.cpp + DerivedConformance/DerivedConformanceComparable.cpp + DerivedConformance/DerivedConformanceDifferentiable.cpp + DerivedConformance/DerivedConformanceDistributedActor.cpp + DerivedConformance/DerivedConformanceEquatableHashable.cpp + DerivedConformance/DerivedConformanceError.cpp + DerivedConformance/DerivedConformanceRawRepresentable.cpp ImportResolution.cpp InstrumenterSupport.cpp LookupVisibleDecls.cpp diff --git a/lib/Sema/CodeSynthesis.cpp b/lib/Sema/CodeSynthesis.cpp index c0ca2d791b766..1346130bdee77 100644 --- a/lib/Sema/CodeSynthesis.cpp +++ b/lib/Sema/CodeSynthesis.cpp @@ -2,7 +2,7 @@ // // This source file is part of the Swift.org open source project // -// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors +// Copyright (c) 2014 - 2025 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 @@ -16,12 +16,12 @@ #include "CodeSynthesis.h" +#include "DerivedConformance/DerivedConformance.h" #include "TypeCheckDecl.h" #include "TypeCheckDistributed.h" #include "TypeCheckObjC.h" #include "TypeCheckType.h" #include "TypeChecker.h" -#include "DerivedConformances.h" #include "swift/AST/ASTMangler.h" #include "swift/AST/ASTPrinter.h" #include "swift/AST/AvailabilityInference.h" diff --git a/lib/Sema/CodeSynthesisDistributedActor.cpp b/lib/Sema/CodeSynthesisDistributedActor.cpp index 1bd4b6e545859..637a5b1ad3192 100644 --- a/lib/Sema/CodeSynthesisDistributedActor.cpp +++ b/lib/Sema/CodeSynthesisDistributedActor.cpp @@ -13,7 +13,7 @@ #include "TypeCheckDistributed.h" #include "CodeSynthesis.h" -#include "DerivedConformances.h" +#include "DerivedConformance/DerivedConformance.h" #include "TypeChecker.h" #include "swift/AST/ASTMangler.h" #include "swift/AST/ASTPrinter.h" diff --git a/lib/Sema/DerivedConformances.cpp b/lib/Sema/DerivedConformance/DerivedConformance.cpp similarity index 99% rename from lib/Sema/DerivedConformances.cpp rename to lib/Sema/DerivedConformance/DerivedConformance.cpp index c0e05b978a3ce..402014b1f7dce 100644 --- a/lib/Sema/DerivedConformances.cpp +++ b/lib/Sema/DerivedConformance/DerivedConformance.cpp @@ -1,8 +1,8 @@ -//===--- DerivedConformances.cpp - Derived conformance utilities ----------===// +//===--- DerivedConformance.cpp ---------------------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // -// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors +// Copyright (c) 2014 - 2025 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 @@ -10,21 +10,21 @@ // //===----------------------------------------------------------------------===// -#include "TypeChecker.h" +#include "DerivedConformance.h" #include "TypeCheckConcurrency.h" +#include "TypeChecker.h" #include "swift/AST/ASTPrinter.h" #include "swift/AST/ConformanceLookup.h" #include "swift/AST/Decl.h" -#include "swift/AST/Stmt.h" #include "swift/AST/Expr.h" -#include "swift/AST/Pattern.h" #include "swift/AST/ParameterList.h" +#include "swift/AST/Pattern.h" #include "swift/AST/ProtocolConformance.h" #include "swift/AST/SourceFile.h" +#include "swift/AST/Stmt.h" #include "swift/AST/Types.h" #include "swift/Basic/Assertions.h" #include "swift/ClangImporter/ClangModule.h" -#include "DerivedConformances.h" using namespace swift; diff --git a/lib/Sema/DerivedConformances.h b/lib/Sema/DerivedConformance/DerivedConformance.h similarity index 98% rename from lib/Sema/DerivedConformances.h rename to lib/Sema/DerivedConformance/DerivedConformance.h index ba145adbfce64..e15283e6efb64 100644 --- a/lib/Sema/DerivedConformances.h +++ b/lib/Sema/DerivedConformance/DerivedConformance.h @@ -1,8 +1,8 @@ -//===--- DerivedConformances.h - Derived protocol conformance ---*- C++ -*-===// +//===--- DerivedConformance.h -----------------------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // -// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors +// Copyright (c) 2014 - 2025 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 @@ -15,11 +15,11 @@ // //===----------------------------------------------------------------------===// -#ifndef SWIFT_SEMA_DERIVEDCONFORMANCES_H -#define SWIFT_SEMA_DERIVEDCONFORMANCES_H +#ifndef SWIFT_SEMA_DERIVEDCONFORMANCE_DERIVEDCONFORMANCE_H +#define SWIFT_SEMA_DERIVEDCONFORMANCE_DERIVEDCONFORMANCE_H -#include "swift/Basic/LLVM.h" #include "swift/AST/Builtins.h" +#include "swift/Basic/LLVM.h" #include namespace swift { diff --git a/lib/Sema/DerivedConformanceActor.cpp b/lib/Sema/DerivedConformance/DerivedConformanceActor.cpp similarity index 98% rename from lib/Sema/DerivedConformanceActor.cpp rename to lib/Sema/DerivedConformance/DerivedConformanceActor.cpp index 54f87f4ed165a..7fdcb683096fa 100644 --- a/lib/Sema/DerivedConformanceActor.cpp +++ b/lib/Sema/DerivedConformance/DerivedConformanceActor.cpp @@ -1,8 +1,8 @@ -//===--- DerivedConformanceActor.cpp --------------------------------------===// +//===--- DerivedConformanceActor.cpp ----------------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // -// Copyright (c) 2018 - 2020 Apple Inc. and the Swift project authors +// Copyright (c) 2018 - 2025 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 @@ -19,7 +19,7 @@ //===----------------------------------------------------------------------===// #include "CodeSynthesis.h" -#include "DerivedConformances.h" +#include "DerivedConformance.h" #include "TypeChecker.h" #include "swift/AST/AvailabilityInference.h" #include "swift/AST/Decl.h" diff --git a/lib/Sema/DerivedConformanceAdditiveArithmetic.cpp b/lib/Sema/DerivedConformance/DerivedConformanceAdditiveArithmetic.cpp similarity index 99% rename from lib/Sema/DerivedConformanceAdditiveArithmetic.cpp rename to lib/Sema/DerivedConformance/DerivedConformanceAdditiveArithmetic.cpp index a02988e7313ed..8536399325c01 100644 --- a/lib/Sema/DerivedConformanceAdditiveArithmetic.cpp +++ b/lib/Sema/DerivedConformance/DerivedConformanceAdditiveArithmetic.cpp @@ -1,8 +1,8 @@ -//===--- DerivedConformanceAdditiveArithmetic.cpp -------------------------===// +//===--- DerivedConformanceAdditiveArithmetic.cpp ---------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // -// Copyright (c) 2018 - 2020 Apple Inc. and the Swift project authors +// Copyright (c) 2018 - 2025 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 @@ -22,6 +22,7 @@ //===----------------------------------------------------------------------===// #include "CodeSynthesis.h" +#include "DerivedConformance.h" #include "TypeChecker.h" #include "swift/AST/ConformanceLookup.h" #include "swift/AST/Decl.h" @@ -33,7 +34,6 @@ #include "swift/AST/Stmt.h" #include "swift/AST/Types.h" #include "swift/Basic/Assertions.h" -#include "DerivedConformances.h" using namespace swift; diff --git a/lib/Sema/DerivedConformanceCaseIterable.cpp b/lib/Sema/DerivedConformance/DerivedConformanceCaseIterable.cpp similarity index 92% rename from lib/Sema/DerivedConformanceCaseIterable.cpp rename to lib/Sema/DerivedConformance/DerivedConformanceCaseIterable.cpp index 532264cc9362d..dfdb509013b70 100644 --- a/lib/Sema/DerivedConformanceCaseIterable.cpp +++ b/lib/Sema/DerivedConformance/DerivedConformanceCaseIterable.cpp @@ -1,11 +1,12 @@ +//===--- DerivedConformanceCaseIterable.cpp ---------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // -// Copyright (c) 2016 Apple Inc. and the Swift project authors +// Copyright (c) 2018 - 2025 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // -// See http://swift.org/LICENSE.txt for license information -// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +// See https://swift.org/LICENSE.txt for license information +// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// // @@ -13,13 +14,13 @@ // //===----------------------------------------------------------------------===// +#include "DerivedConformance.h" #include "TypeChecker.h" #include "swift/AST/Decl.h" -#include "swift/AST/Stmt.h" #include "swift/AST/Expr.h" +#include "swift/AST/Stmt.h" #include "swift/AST/Types.h" #include "llvm/Support/raw_ostream.h" -#include "DerivedConformances.h" using namespace swift; diff --git a/lib/Sema/DerivedConformanceCodable.cpp b/lib/Sema/DerivedConformance/DerivedConformanceCodable.cpp similarity index 99% rename from lib/Sema/DerivedConformanceCodable.cpp rename to lib/Sema/DerivedConformance/DerivedConformanceCodable.cpp index 291e60ac276f4..1d3485abae883 100644 --- a/lib/Sema/DerivedConformanceCodable.cpp +++ b/lib/Sema/DerivedConformance/DerivedConformanceCodable.cpp @@ -1,8 +1,8 @@ -//===--- DerivedConformanceCodable.cpp - Derived Codable ------------------===// +//===--- DerivedConformanceCodable.cpp --------------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // -// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors +// Copyright (c) 2014 - 2025 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 @@ -16,8 +16,8 @@ //===----------------------------------------------------------------------===// #include "CodeSynthesis.h" +#include "DerivedConformance.h" #include "TypeChecker.h" -#include "llvm/ADT/STLExtras.h" #include "swift/AST/ConformanceLookup.h" #include "swift/AST/Decl.h" #include "swift/AST/Expr.h" @@ -28,7 +28,7 @@ #include "swift/AST/Types.h" #include "swift/Basic/Assertions.h" #include "swift/Basic/StringExtras.h" -#include "DerivedConformances.h" +#include "llvm/ADT/STLExtras.h" using namespace swift; diff --git a/lib/Sema/DerivedConformanceCodingKey.cpp b/lib/Sema/DerivedConformance/DerivedConformanceCodingKey.cpp similarity index 99% rename from lib/Sema/DerivedConformanceCodingKey.cpp rename to lib/Sema/DerivedConformance/DerivedConformanceCodingKey.cpp index 879bf0f03d005..0c84f71aa84ac 100644 --- a/lib/Sema/DerivedConformanceCodingKey.cpp +++ b/lib/Sema/DerivedConformance/DerivedConformanceCodingKey.cpp @@ -1,8 +1,8 @@ -//===--- DerivedConformanceCodingKey.cpp - Derived CodingKey --------------===// +//===--- DerivedConformanceCodingKey.cpp ------------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // -// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors +// Copyright (c) 2014 - 2025 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 @@ -15,6 +15,7 @@ // //===----------------------------------------------------------------------===// +#include "DerivedConformance.h" #include "TypeChecker.h" #include "swift/AST/Decl.h" #include "swift/AST/Expr.h" @@ -22,7 +23,6 @@ #include "swift/AST/Pattern.h" #include "swift/AST/Stmt.h" #include "swift/AST/Types.h" -#include "DerivedConformances.h" using namespace swift; diff --git a/lib/Sema/DerivedConformanceComparable.cpp b/lib/Sema/DerivedConformance/DerivedConformanceComparable.cpp similarity index 98% rename from lib/Sema/DerivedConformanceComparable.cpp rename to lib/Sema/DerivedConformance/DerivedConformanceComparable.cpp index 6269fc2f0a0ad..c5468e83a70ed 100644 --- a/lib/Sema/DerivedConformanceComparable.cpp +++ b/lib/Sema/DerivedConformance/DerivedConformanceComparable.cpp @@ -1,8 +1,8 @@ -//===--- DerivedConformanceComparable.cpp - Derived Comparable -===// +//===--- DerivedConformanceComparable.cpp -----------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // -// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors +// Copyright (c) 2014 - 2025 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 @@ -11,25 +11,26 @@ //===----------------------------------------------------------------------===// // // This file implements implicit derivation of the Comparable protocol. -// (Most of this code is similar to code in `DerivedConformanceEquatableHashable.cpp`) +// (Most of this code is similar to code in +// `DerivedConformanceEquatableHashable.cpp`) // //===----------------------------------------------------------------------===// #include "CodeSynthesis.h" +#include "DerivedConformance.h" #include "TypeChecker.h" #include "swift/AST/Decl.h" -#include "swift/AST/Stmt.h" #include "swift/AST/Expr.h" #include "swift/AST/Module.h" -#include "swift/AST/Pattern.h" #include "swift/AST/ParameterList.h" +#include "swift/AST/Pattern.h" #include "swift/AST/ProtocolConformance.h" +#include "swift/AST/Stmt.h" #include "swift/AST/Types.h" #include "swift/Basic/Assertions.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/raw_ostream.h" -#include "DerivedConformances.h" using namespace swift; diff --git a/lib/Sema/DerivedConformanceDifferentiable.cpp b/lib/Sema/DerivedConformance/DerivedConformanceDifferentiable.cpp similarity index 99% rename from lib/Sema/DerivedConformanceDifferentiable.cpp rename to lib/Sema/DerivedConformance/DerivedConformanceDifferentiable.cpp index d4f9ac58c1b23..58c317a61aa6f 100644 --- a/lib/Sema/DerivedConformanceDifferentiable.cpp +++ b/lib/Sema/DerivedConformance/DerivedConformanceDifferentiable.cpp @@ -1,8 +1,8 @@ -//===--- DerivedConformanceDifferentiable.cpp - Derived Differentiable ----===// +//===--- DerivedConformanceDifferentiable.cpp -------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // -// Copyright (c) 2019 - 2020 Apple Inc. and the Swift project authors +// Copyright (c) 2019 - 2025 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 @@ -16,9 +16,9 @@ //===----------------------------------------------------------------------===// #include "CodeSynthesis.h" -#include "TypeChecker.h" +#include "DerivedConformance.h" #include "TypeCheckType.h" -#include "llvm/ADT/SmallPtrSet.h" +#include "TypeChecker.h" #include "swift/AST/AutoDiff.h" #include "swift/AST/ConformanceLookup.h" #include "swift/AST/Decl.h" @@ -32,7 +32,7 @@ #include "swift/AST/TypeCheckRequests.h" #include "swift/AST/Types.h" #include "swift/Basic/Assertions.h" -#include "DerivedConformances.h" +#include "llvm/ADT/SmallPtrSet.h" using namespace swift; diff --git a/lib/Sema/DerivedConformanceDistributedActor.cpp b/lib/Sema/DerivedConformance/DerivedConformanceDistributedActor.cpp similarity index 99% rename from lib/Sema/DerivedConformanceDistributedActor.cpp rename to lib/Sema/DerivedConformance/DerivedConformanceDistributedActor.cpp index 385074f80b1ad..2dc2831712d06 100644 --- a/lib/Sema/DerivedConformanceDistributedActor.cpp +++ b/lib/Sema/DerivedConformance/DerivedConformanceDistributedActor.cpp @@ -1,8 +1,8 @@ -//===--- DerivedConformanceActor.cpp - Derived Actor Conformance ----------===// +//===--- DerivedConformanceActor.cpp ----------------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // -// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors +// Copyright (c) 2014 - 2025 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 @@ -15,7 +15,7 @@ //===----------------------------------------------------------------------===// #include "CodeSynthesis.h" -#include "DerivedConformances.h" +#include "DerivedConformance.h" #include "TypeCheckDistributed.h" #include "TypeChecker.h" #include "swift/AST/AvailabilityInference.h" diff --git a/lib/Sema/DerivedConformanceEquatableHashable.cpp b/lib/Sema/DerivedConformance/DerivedConformanceEquatableHashable.cpp similarity index 99% rename from lib/Sema/DerivedConformanceEquatableHashable.cpp rename to lib/Sema/DerivedConformance/DerivedConformanceEquatableHashable.cpp index 6240036daebe8..45021cf1f21e3 100644 --- a/lib/Sema/DerivedConformanceEquatableHashable.cpp +++ b/lib/Sema/DerivedConformance/DerivedConformanceEquatableHashable.cpp @@ -1,8 +1,8 @@ -//===--- DerivedConformanceEquatableHashable.cpp - Derived Equatable & co -===// +//===--- DerivedConformanceEquatableHashable.cpp ----------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // -// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors +// Copyright (c) 2014 - 2025 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 @@ -11,25 +11,25 @@ //===----------------------------------------------------------------------===// // // This file implements implicit derivation of the Equatable and Hashable -// protocols. +// protocols. // //===----------------------------------------------------------------------===// #include "CodeSynthesis.h" +#include "DerivedConformance.h" #include "TypeChecker.h" #include "swift/AST/Decl.h" -#include "swift/AST/Stmt.h" #include "swift/AST/Expr.h" #include "swift/AST/Module.h" -#include "swift/AST/Pattern.h" #include "swift/AST/ParameterList.h" +#include "swift/AST/Pattern.h" #include "swift/AST/ProtocolConformance.h" +#include "swift/AST/Stmt.h" #include "swift/AST/Types.h" #include "swift/Basic/Assertions.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/raw_ostream.h" -#include "DerivedConformances.h" using namespace swift; diff --git a/lib/Sema/DerivedConformanceError.cpp b/lib/Sema/DerivedConformance/DerivedConformanceError.cpp similarity index 96% rename from lib/Sema/DerivedConformanceError.cpp rename to lib/Sema/DerivedConformance/DerivedConformanceError.cpp index 56fc69a73aeb5..82d8465900283 100644 --- a/lib/Sema/DerivedConformanceError.cpp +++ b/lib/Sema/DerivedConformance/DerivedConformanceError.cpp @@ -1,8 +1,8 @@ -//===--- DerivedConformanceError.cpp - Derived Error ----------------------===// +//===--- DerivedConformanceError.cpp ----------------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // -// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors +// Copyright (c) 2014 - 2025 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 @@ -16,14 +16,14 @@ //===----------------------------------------------------------------------===// #include "CodeSynthesis.h" +#include "DerivedConformance.h" #include "TypeChecker.h" -#include "DerivedConformances.h" #include "swift/AST/Decl.h" -#include "swift/AST/Stmt.h" #include "swift/AST/Expr.h" #include "swift/AST/Module.h" -#include "swift/AST/Types.h" +#include "swift/AST/Stmt.h" #include "swift/AST/SwiftNameTranslation.h" +#include "swift/AST/Types.h" using namespace swift; using namespace swift::objc_translation; diff --git a/lib/Sema/DerivedConformanceRawRepresentable.cpp b/lib/Sema/DerivedConformance/DerivedConformanceRawRepresentable.cpp similarity index 99% rename from lib/Sema/DerivedConformanceRawRepresentable.cpp rename to lib/Sema/DerivedConformance/DerivedConformanceRawRepresentable.cpp index 4f64bed1c8344..209bb71fcd1c2 100644 --- a/lib/Sema/DerivedConformanceRawRepresentable.cpp +++ b/lib/Sema/DerivedConformance/DerivedConformanceRawRepresentable.cpp @@ -1,8 +1,8 @@ -//===--- DerivedConformanceRawRepresentable.cpp - Derived RawRepresentable ===// +//===--- DerivedConformanceRawRepresentable.cpp -----------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // -// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors +// Copyright (c) 2014 - 2025 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 @@ -16,7 +16,7 @@ //===----------------------------------------------------------------------===// #include "CodeSynthesis.h" -#include "DerivedConformances.h" +#include "DerivedConformance.h" #include "TypeCheckAvailability.h" #include "TypeCheckDecl.h" #include "TypeChecker.h" diff --git a/lib/Sema/TypeCheckDecl.cpp b/lib/Sema/TypeCheckDecl.cpp index 32bea59fd1200..4aeeeec1f98cf 100644 --- a/lib/Sema/TypeCheckDecl.cpp +++ b/lib/Sema/TypeCheckDecl.cpp @@ -2,7 +2,7 @@ // // This source file is part of the Swift.org open source project // -// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors +// Copyright (c) 2014 - 2025 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 @@ -16,7 +16,7 @@ #include "TypeCheckDecl.h" #include "CodeSynthesis.h" -#include "DerivedConformances.h" +#include "DerivedConformance/DerivedConformance.h" #include "MiscDiagnostics.h" #include "TypeCheckAccess.h" #include "TypeCheckAvailability.h" diff --git a/lib/Sema/TypeCheckDeclPrimary.cpp b/lib/Sema/TypeCheckDeclPrimary.cpp index 09655a05d246f..ba1b55c2697f1 100644 --- a/lib/Sema/TypeCheckDeclPrimary.cpp +++ b/lib/Sema/TypeCheckDeclPrimary.cpp @@ -2,7 +2,7 @@ // // This source file is part of the Swift.org open source project // -// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors +// Copyright (c) 2014 - 2025 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 @@ -17,7 +17,7 @@ //===----------------------------------------------------------------------===// #include "CodeSynthesis.h" -#include "DerivedConformances.h" +#include "DerivedConformance/DerivedConformance.h" #include "MiscDiagnostics.h" #include "TypeCheckAccess.h" #include "TypeCheckAvailability.h" diff --git a/lib/Sema/TypeCheckProtocol.cpp b/lib/Sema/TypeCheckProtocol.cpp index 2d541f5dac846..7d6cf77d6c00c 100644 --- a/lib/Sema/TypeCheckProtocol.cpp +++ b/lib/Sema/TypeCheckProtocol.cpp @@ -2,7 +2,7 @@ // // This source file is part of the Swift.org open source project // -// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors +// Copyright (c) 2014 - 2025 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 @@ -15,7 +15,7 @@ //===----------------------------------------------------------------------===// #include "TypeCheckProtocol.h" -#include "DerivedConformances.h" +#include "DerivedConformance/DerivedConformance.h" #include "MiscDiagnostics.h" #include "OpenedExistentials.h" #include "TypeAccessScopeChecker.h"