Files
swift-mirror/lib/IRGen/IRGenSILPasses.cpp
Hamish Knight 13bfac1820 Register IRGen SIL passes with the ASTContext
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.
2020-02-14 09:57:27 -08:00

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);
}