mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Sema] Decouple ConstraintSystem and TypeChecker headers
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
#include "ConstraintGraph.h"
|
||||
#include "ConstraintSystem.h"
|
||||
#include "TypeChecker.h"
|
||||
#include "llvm/ADT/SetVector.h"
|
||||
#include <tuple>
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "ConstraintSystem.h"
|
||||
#include "TypeChecker.h"
|
||||
|
||||
using namespace swift;
|
||||
using namespace swift::constraints;
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "Constraint.h"
|
||||
#include "ConstraintSystem.h"
|
||||
#include "OverloadChoice.h"
|
||||
#include "TypeChecker.h"
|
||||
#include "swift/AST/ASTContext.h"
|
||||
#include "swift/AST/ASTNode.h"
|
||||
#include "swift/AST/Decl.h"
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "ConstraintGraph.h"
|
||||
#include "ConstraintSystem.h"
|
||||
#include "TypeCheckType.h"
|
||||
#include "TypeChecker.h"
|
||||
#include "swift/AST/ASTVisitor.h"
|
||||
#include "swift/AST/ASTWalker.h"
|
||||
#include "swift/AST/Expr.h"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
#include "ConstraintSystem.h"
|
||||
#include "TypeChecker.h"
|
||||
#include "swift/AST/GenericSignature.h"
|
||||
#include "swift/AST/ParameterList.h"
|
||||
#include "swift/AST/ProtocolConformance.h"
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "ConstraintSystem.h"
|
||||
#include "SolutionResult.h"
|
||||
#include "TypeCheckType.h"
|
||||
#include "TypeChecker.h"
|
||||
#include "swift/AST/ParameterList.h"
|
||||
#include "swift/AST/TypeWalker.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
|
||||
@@ -24,16 +24,20 @@
|
||||
#include "ConstraintGraphScope.h"
|
||||
#include "ConstraintLocator.h"
|
||||
#include "OverloadChoice.h"
|
||||
#include "TypeChecker.h"
|
||||
#include "SolutionResult.h"
|
||||
#include "swift/AST/ASTContext.h"
|
||||
#include "swift/AST/ASTNode.h"
|
||||
#include "swift/AST/ASTVisitor.h"
|
||||
#include "swift/AST/ASTWalker.h"
|
||||
#include "swift/AST/AnyFunctionRef.h"
|
||||
#include "swift/AST/DiagnosticsSema.h"
|
||||
#include "swift/AST/NameLookup.h"
|
||||
#include "swift/AST/PropertyWrappers.h"
|
||||
#include "swift/AST/Types.h"
|
||||
#include "swift/Basic/Debug.h"
|
||||
#include "swift/Basic/LLVM.h"
|
||||
#include "swift/Basic/OptionSet.h"
|
||||
#include "llvm/ADT/MapVector.h"
|
||||
#include "llvm/ADT/PointerUnion.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/ADT/SetOperations.h"
|
||||
@@ -49,15 +53,32 @@
|
||||
namespace swift {
|
||||
|
||||
class Expr;
|
||||
class FuncDecl;
|
||||
class BraseStmt;
|
||||
enum class TypeCheckExprFlags;
|
||||
|
||||
namespace constraints {
|
||||
|
||||
class ConstraintGraph;
|
||||
class ConstraintGraphNode;
|
||||
class ConstraintSystem;
|
||||
class SolutionApplicationTarget;
|
||||
|
||||
} // end namespace constraints
|
||||
|
||||
// Forward declare some TypeChecker related functions
|
||||
// so they could be made friends of ConstraintSystem.
|
||||
namespace TypeChecker {
|
||||
|
||||
Optional<BraceStmt *> applyFunctionBuilderBodyTransform(FuncDecl *func,
|
||||
Type builderType);
|
||||
|
||||
Optional<constraints::SolutionApplicationTarget>
|
||||
typeCheckExpression(constraints::SolutionApplicationTarget &target,
|
||||
OptionSet<TypeCheckExprFlags> options);
|
||||
|
||||
} // end namespace TypeChecker
|
||||
|
||||
} // end namespace swift
|
||||
|
||||
/// Allocate memory within the given constraint system.
|
||||
@@ -2730,9 +2751,10 @@ private:
|
||||
friend Optional<BraceStmt *>
|
||||
swift::TypeChecker::applyFunctionBuilderBodyTransform(FuncDecl *func,
|
||||
Type builderType);
|
||||
|
||||
friend Optional<SolutionApplicationTarget>
|
||||
swift::TypeChecker::typeCheckExpression(SolutionApplicationTarget &target,
|
||||
TypeCheckExprOptions options);
|
||||
swift::TypeChecker::typeCheckExpression(
|
||||
SolutionApplicationTarget &target, OptionSet<TypeCheckExprFlags> options);
|
||||
|
||||
/// Emit the fixes computed as part of the solution, returning true if we were
|
||||
/// able to emit an error message, or false if none of the fixits worked out.
|
||||
|
||||
Reference in New Issue
Block a user