Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFC] Sema: Factor out some sources into subdirectories #80529

Merged
merged 1 commit into from
Apr 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lib/Sema/AssociatedTypeInference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
24 changes: 12 additions & 12 deletions lib/Sema/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/Sema/CodeSynthesis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion lib/Sema/CodeSynthesisDistributedActor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
//===--- 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
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

#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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 <utility>

namespace swift {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -22,6 +22,7 @@
//===----------------------------------------------------------------------===//

#include "CodeSynthesis.h"
#include "DerivedConformance.h"
#include "TypeChecker.h"
#include "swift/AST/ConformanceLookup.h"
#include "swift/AST/Decl.h"
Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
//===--- 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
//
//===----------------------------------------------------------------------===//
//
// This file implements implicit derivation of the CaseIterable protocol.
//
//===----------------------------------------------------------------------===//

#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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -15,14 +15,14 @@
//
//===----------------------------------------------------------------------===//

#include "DerivedConformance.h"
#include "TypeChecker.h"
#include "swift/AST/Decl.h"
#include "swift/AST/Expr.h"
#include "swift/AST/ParameterList.h"
#include "swift/AST/Pattern.h"
#include "swift/AST/Stmt.h"
#include "swift/AST/Types.h"
#include "DerivedConformances.h"

using namespace swift;

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -15,7 +15,7 @@
//===----------------------------------------------------------------------===//

#include "CodeSynthesis.h"
#include "DerivedConformances.h"
#include "DerivedConformance.h"
#include "TypeCheckDistributed.h"
#include "TypeChecker.h"
#include "swift/AST/AvailabilityInference.h"
Expand Down
Loading