Skip to content

Commit 2784fe6

Browse files
Merge pull request #80602 from AnthonyLatsis/ammanita-pantherina-6.2
[6.2][NFC] Sema: Factor out derived conformance sources into subdirectory
2 parents e8c85fa + b1c4ead commit 2784fe6

20 files changed

+85
-82
lines changed

lib/Sema/AssociatedTypeInference.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2024 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -30,12 +30,13 @@
3030
// a global conformance lookup.
3131
//
3232
//===----------------------------------------------------------------------===//
33-
#include "TypeCheckProtocol.h"
34-
#include "DerivedConformances.h"
33+
34+
#include "DerivedConformance/DerivedConformance.h"
3535
#include "TypeAccessScopeChecker.h"
36-
#include "TypeChecker.h"
3736
#include "TypeCheckAvailability.h"
37+
#include "TypeCheckProtocol.h"
3838
#include "TypeCheckType.h"
39+
#include "TypeChecker.h"
3940

4041
#include "swift/AST/AvailabilityInference.h"
4142
#include "swift/AST/ConformanceLookup.h"

lib/Sema/CMakeLists.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ add_swift_host_library(swiftSema STATIC
2424
ConstraintSystem.cpp
2525
CompletionContextFinder.cpp
2626
DebuggerTestingTransform.cpp
27-
DerivedConformanceActor.cpp
28-
DerivedConformanceDistributedActor.cpp
29-
DerivedConformanceAdditiveArithmetic.cpp
30-
DerivedConformanceCaseIterable.cpp
31-
DerivedConformanceCodable.cpp
32-
DerivedConformanceCodingKey.cpp
33-
DerivedConformanceDifferentiable.cpp
34-
DerivedConformanceEquatableHashable.cpp
35-
DerivedConformanceComparable.cpp
36-
DerivedConformanceError.cpp
37-
DerivedConformanceRawRepresentable.cpp
38-
DerivedConformances.cpp
27+
DerivedConformance/DerivedConformance.cpp
28+
DerivedConformance/DerivedConformanceActor.cpp
29+
DerivedConformance/DerivedConformanceAdditiveArithmetic.cpp
30+
DerivedConformance/DerivedConformanceCaseIterable.cpp
31+
DerivedConformance/DerivedConformanceCodable.cpp
32+
DerivedConformance/DerivedConformanceCodingKey.cpp
33+
DerivedConformance/DerivedConformanceComparable.cpp
34+
DerivedConformance/DerivedConformanceDifferentiable.cpp
35+
DerivedConformance/DerivedConformanceDistributedActor.cpp
36+
DerivedConformance/DerivedConformanceEquatableHashable.cpp
37+
DerivedConformance/DerivedConformanceError.cpp
38+
DerivedConformance/DerivedConformanceRawRepresentable.cpp
3939
ImportResolution.cpp
4040
InstrumenterSupport.cpp
4141
LookupVisibleDecls.cpp

lib/Sema/CodeSynthesis.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -16,12 +16,12 @@
1616

1717
#include "CodeSynthesis.h"
1818

19+
#include "DerivedConformance/DerivedConformance.h"
1920
#include "TypeCheckDecl.h"
2021
#include "TypeCheckDistributed.h"
2122
#include "TypeCheckObjC.h"
2223
#include "TypeCheckType.h"
2324
#include "TypeChecker.h"
24-
#include "DerivedConformances.h"
2525
#include "swift/AST/ASTMangler.h"
2626
#include "swift/AST/ASTPrinter.h"
2727
#include "swift/AST/AvailabilityInference.h"

lib/Sema/CodeSynthesisDistributedActor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "TypeCheckDistributed.h"
1414

1515
#include "CodeSynthesis.h"
16-
#include "DerivedConformances.h"
16+
#include "DerivedConformance/DerivedConformance.h"
1717
#include "TypeChecker.h"
1818
#include "swift/AST/ASTMangler.h"
1919
#include "swift/AST/ASTPrinter.h"

lib/Sema/DerivedConformances.cpp renamed to lib/Sema/DerivedConformance/DerivedConformance.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
//===--- DerivedConformances.cpp - Derived conformance utilities ----------===//
1+
//===--- DerivedConformance.cpp ---------------------------------*- C++ -*-===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
99
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#include "TypeChecker.h"
13+
#include "DerivedConformance.h"
1414
#include "TypeCheckConcurrency.h"
15+
#include "TypeChecker.h"
1516
#include "swift/AST/ASTPrinter.h"
1617
#include "swift/AST/ConformanceLookup.h"
1718
#include "swift/AST/Decl.h"
18-
#include "swift/AST/Stmt.h"
1919
#include "swift/AST/Expr.h"
20-
#include "swift/AST/Pattern.h"
2120
#include "swift/AST/ParameterList.h"
21+
#include "swift/AST/Pattern.h"
2222
#include "swift/AST/ProtocolConformance.h"
2323
#include "swift/AST/SourceFile.h"
24+
#include "swift/AST/Stmt.h"
2425
#include "swift/AST/Types.h"
2526
#include "swift/Basic/Assertions.h"
2627
#include "swift/ClangImporter/ClangModule.h"
27-
#include "DerivedConformances.h"
2828

2929
using namespace swift;
3030

lib/Sema/DerivedConformances.h renamed to lib/Sema/DerivedConformance/DerivedConformance.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//===--- DerivedConformances.h - Derived protocol conformance ---*- C++ -*-===//
1+
//===--- DerivedConformance.h -----------------------------------*- C++ -*-===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -15,11 +15,11 @@
1515
//
1616
//===----------------------------------------------------------------------===//
1717

18-
#ifndef SWIFT_SEMA_DERIVEDCONFORMANCES_H
19-
#define SWIFT_SEMA_DERIVEDCONFORMANCES_H
18+
#ifndef SWIFT_SEMA_DERIVEDCONFORMANCE_DERIVEDCONFORMANCE_H
19+
#define SWIFT_SEMA_DERIVEDCONFORMANCE_DERIVEDCONFORMANCE_H
2020

21-
#include "swift/Basic/LLVM.h"
2221
#include "swift/AST/Builtins.h"
22+
#include "swift/Basic/LLVM.h"
2323
#include <utility>
2424

2525
namespace swift {

lib/Sema/DerivedConformanceActor.cpp renamed to lib/Sema/DerivedConformance/DerivedConformanceActor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//===--- DerivedConformanceActor.cpp --------------------------------------===//
1+
//===--- DerivedConformanceActor.cpp ----------------------------*- C++ -*-===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2018 - 2020 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2018 - 2025 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -19,7 +19,7 @@
1919
//===----------------------------------------------------------------------===//
2020

2121
#include "CodeSynthesis.h"
22-
#include "DerivedConformances.h"
22+
#include "DerivedConformance.h"
2323
#include "TypeChecker.h"
2424
#include "swift/AST/AvailabilityInference.h"
2525
#include "swift/AST/Decl.h"

lib/Sema/DerivedConformanceAdditiveArithmetic.cpp renamed to lib/Sema/DerivedConformance/DerivedConformanceAdditiveArithmetic.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//===--- DerivedConformanceAdditiveArithmetic.cpp -------------------------===//
1+
//===--- DerivedConformanceAdditiveArithmetic.cpp ---------------*- C++ -*-===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2018 - 2020 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2018 - 2025 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -22,6 +22,7 @@
2222
//===----------------------------------------------------------------------===//
2323

2424
#include "CodeSynthesis.h"
25+
#include "DerivedConformance.h"
2526
#include "TypeChecker.h"
2627
#include "swift/AST/ConformanceLookup.h"
2728
#include "swift/AST/Decl.h"
@@ -33,7 +34,6 @@
3334
#include "swift/AST/Stmt.h"
3435
#include "swift/AST/Types.h"
3536
#include "swift/Basic/Assertions.h"
36-
#include "DerivedConformances.h"
3737

3838
using namespace swift;
3939

lib/Sema/DerivedConformanceCaseIterable.cpp renamed to lib/Sema/DerivedConformance/DerivedConformanceCaseIterable.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1+
//===--- DerivedConformanceCaseIterable.cpp ---------------------*- C++ -*-===//
12
//
23
// This source file is part of the Swift.org open source project
34
//
4-
// Copyright (c) 2016 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2018 - 2025 Apple Inc. and the Swift project authors
56
// Licensed under Apache License v2.0 with Runtime Library Exception
67
//
7-
// See http://swift.org/LICENSE.txt for license information
8-
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
910
//
1011
//===----------------------------------------------------------------------===//
1112
//
1213
// This file implements implicit derivation of the CaseIterable protocol.
1314
//
1415
//===----------------------------------------------------------------------===//
1516

17+
#include "DerivedConformance.h"
1618
#include "TypeChecker.h"
1719
#include "swift/AST/Decl.h"
18-
#include "swift/AST/Stmt.h"
1920
#include "swift/AST/Expr.h"
21+
#include "swift/AST/Stmt.h"
2022
#include "swift/AST/Types.h"
2123
#include "llvm/Support/raw_ostream.h"
22-
#include "DerivedConformances.h"
2324

2425
using namespace swift;
2526

lib/Sema/DerivedConformanceCodable.cpp renamed to lib/Sema/DerivedConformance/DerivedConformanceCodable.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//===--- DerivedConformanceCodable.cpp - Derived Codable ------------------===//
1+
//===--- DerivedConformanceCodable.cpp --------------------------*- C++ -*-===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -16,8 +16,8 @@
1616
//===----------------------------------------------------------------------===//
1717

1818
#include "CodeSynthesis.h"
19+
#include "DerivedConformance.h"
1920
#include "TypeChecker.h"
20-
#include "llvm/ADT/STLExtras.h"
2121
#include "swift/AST/ConformanceLookup.h"
2222
#include "swift/AST/Decl.h"
2323
#include "swift/AST/Expr.h"
@@ -28,7 +28,7 @@
2828
#include "swift/AST/Types.h"
2929
#include "swift/Basic/Assertions.h"
3030
#include "swift/Basic/StringExtras.h"
31-
#include "DerivedConformances.h"
31+
#include "llvm/ADT/STLExtras.h"
3232

3333
using namespace swift;
3434

lib/Sema/DerivedConformanceCodingKey.cpp renamed to lib/Sema/DerivedConformance/DerivedConformanceCodingKey.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//===--- DerivedConformanceCodingKey.cpp - Derived CodingKey --------------===//
1+
//===--- DerivedConformanceCodingKey.cpp ------------------------*- C++ -*-===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -15,14 +15,14 @@
1515
//
1616
//===----------------------------------------------------------------------===//
1717

18+
#include "DerivedConformance.h"
1819
#include "TypeChecker.h"
1920
#include "swift/AST/Decl.h"
2021
#include "swift/AST/Expr.h"
2122
#include "swift/AST/ParameterList.h"
2223
#include "swift/AST/Pattern.h"
2324
#include "swift/AST/Stmt.h"
2425
#include "swift/AST/Types.h"
25-
#include "DerivedConformances.h"
2626

2727
using namespace swift;
2828

lib/Sema/DerivedConformanceComparable.cpp renamed to lib/Sema/DerivedConformance/DerivedConformanceComparable.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//===--- DerivedConformanceComparable.cpp - Derived Comparable -===//
1+
//===--- DerivedConformanceComparable.cpp -----------------------*- C++ -*-===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -11,25 +11,26 @@
1111
//===----------------------------------------------------------------------===//
1212
//
1313
// This file implements implicit derivation of the Comparable protocol.
14-
// (Most of this code is similar to code in `DerivedConformanceEquatableHashable.cpp`)
14+
// (Most of this code is similar to code in
15+
// `DerivedConformanceEquatableHashable.cpp`)
1516
//
1617
//===----------------------------------------------------------------------===//
1718

1819
#include "CodeSynthesis.h"
20+
#include "DerivedConformance.h"
1921
#include "TypeChecker.h"
2022
#include "swift/AST/Decl.h"
21-
#include "swift/AST/Stmt.h"
2223
#include "swift/AST/Expr.h"
2324
#include "swift/AST/Module.h"
24-
#include "swift/AST/Pattern.h"
2525
#include "swift/AST/ParameterList.h"
26+
#include "swift/AST/Pattern.h"
2627
#include "swift/AST/ProtocolConformance.h"
28+
#include "swift/AST/Stmt.h"
2729
#include "swift/AST/Types.h"
2830
#include "swift/Basic/Assertions.h"
2931
#include "llvm/ADT/APInt.h"
3032
#include "llvm/ADT/SmallString.h"
3133
#include "llvm/Support/raw_ostream.h"
32-
#include "DerivedConformances.h"
3334

3435
using namespace swift;
3536

lib/Sema/DerivedConformanceDifferentiable.cpp renamed to lib/Sema/DerivedConformance/DerivedConformanceDifferentiable.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//===--- DerivedConformanceDifferentiable.cpp - Derived Differentiable ----===//
1+
//===--- DerivedConformanceDifferentiable.cpp -------------------*- C++ -*-===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2019 - 2020 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2019 - 2025 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -16,9 +16,9 @@
1616
//===----------------------------------------------------------------------===//
1717

1818
#include "CodeSynthesis.h"
19-
#include "TypeChecker.h"
19+
#include "DerivedConformance.h"
2020
#include "TypeCheckType.h"
21-
#include "llvm/ADT/SmallPtrSet.h"
21+
#include "TypeChecker.h"
2222
#include "swift/AST/AutoDiff.h"
2323
#include "swift/AST/ConformanceLookup.h"
2424
#include "swift/AST/Decl.h"
@@ -32,7 +32,7 @@
3232
#include "swift/AST/TypeCheckRequests.h"
3333
#include "swift/AST/Types.h"
3434
#include "swift/Basic/Assertions.h"
35-
#include "DerivedConformances.h"
35+
#include "llvm/ADT/SmallPtrSet.h"
3636

3737
using namespace swift;
3838

lib/Sema/DerivedConformanceDistributedActor.cpp renamed to lib/Sema/DerivedConformance/DerivedConformanceDistributedActor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//===--- DerivedConformanceActor.cpp - Derived Actor Conformance ----------===//
1+
//===--- DerivedConformanceActor.cpp ----------------------------*- C++ -*-===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -15,7 +15,7 @@
1515
//===----------------------------------------------------------------------===//
1616

1717
#include "CodeSynthesis.h"
18-
#include "DerivedConformances.h"
18+
#include "DerivedConformance.h"
1919
#include "TypeCheckDistributed.h"
2020
#include "TypeChecker.h"
2121
#include "swift/AST/AvailabilityInference.h"

0 commit comments

Comments
 (0)