mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Rather than registering individual IRGen passes when we want to execute them, store function pointers to all the pass constructors on the ASTContext. This will make it easier to requestify the execution of pass pipelines.
34 lines
1.2 KiB
C++
34 lines
1.2 KiB
C++
//===--- IRGenSILPasses.cpp - The IRGen Prepare SIL Passes ----------------===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2020 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file implements the registration of SILOptimizer passes necessary for
|
|
// IRGen.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "swift/IRGen/IRGenSILPasses.h"
|
|
#include "swift/AST/ASTContext.h"
|
|
#include "swift/Subsystems.h"
|
|
|
|
namespace swift {
|
|
using SILTransformCtor = SILTransform *(void);
|
|
static SILTransformCtor *irgenSILPassFns[] = {
|
|
#define PASS(Name, Tag, Desc)
|
|
#define IRGEN_PASS(Name, Tag, Desc) &irgen::create##Name,
|
|
#include "swift/SILOptimizer/PassManager/Passes.def"
|
|
};
|
|
} // end namespace swift
|
|
|
|
void swift::registerIRGenSILTransforms(ASTContext &ctx) {
|
|
ctx.registerIRGenSILTransforms(irgenSILPassFns);
|
|
}
|