forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request swiftlang#18517 from gottesmm/pr-69d1270fb634f67df…
…bb02afed012bb5cada0dcc1 [passmanager] Change the optimizer to use SILOptFunctionBuilder.
- Loading branch information
Showing
26 changed files
with
264 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
//===--- SILOptFunctionBuilder.h --------------------------------*- C++ -*-===// | ||
// | ||
// This source file is part of the Swift.org open source project | ||
// | ||
// Copyright (c) 2014 - 2018 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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef SWIFT_SILOPTIMIZER_UTILS_SILOPTFUNCTIONBUILDER_H | ||
#define SWIFT_SILOPTIMIZER_UTILS_SILOPTFUNCTIONBUILDER_H | ||
|
||
#include "swift/SIL/SILFunctionBuilder.h" | ||
#include "swift/SILOptimizer/PassManager/PassManager.h" | ||
|
||
namespace swift { | ||
|
||
class SILOptFunctionBuilder { | ||
SILFunctionBuilder builder; | ||
|
||
public: | ||
SILOptFunctionBuilder(SILPassManager &passManager) | ||
: builder(*passManager.getModule()) {} | ||
|
||
template <class... ArgTys> | ||
SILFunction *getOrCreateSharedFunction(ArgTys &&... args) { | ||
return builder.getOrCreateSharedFunction(std::forward<ArgTys>(args)...); | ||
} | ||
|
||
template <class... ArgTys> | ||
SILFunction *getOrCreateFunction(ArgTys &&... args) { | ||
return builder.getOrCreateFunction(std::forward<ArgTys>(args)...); | ||
} | ||
|
||
template <class... ArgTys> SILFunction *createFunction(ArgTys &&... args) { | ||
return builder.createFunction(std::forward<ArgTys>(args)...); | ||
} | ||
}; | ||
|
||
} // namespace swift | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.