mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[passmanager] Change the optimizer to use SILOptFunctionBuilder.
I am going to add the code in a bit that does the notifications. I tried to pass down the builder instead of the pass manager. I also tried not to change the formatting. rdar://42301529
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include "swift/SILOptimizer/Utils/Generics.h"
|
||||
#include "swift/SILOptimizer/Utils/Local.h"
|
||||
#include "swift/SILOptimizer/PassManager/Transforms.h"
|
||||
#include "swift/SILOptimizer/Utils/SILOptFunctionBuilder.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
|
||||
using namespace swift;
|
||||
@@ -48,6 +49,7 @@ class GenericSpecializer : public SILFunctionTransform {
|
||||
} // end anonymous namespace
|
||||
|
||||
bool GenericSpecializer::specializeAppliesInFunction(SILFunction &F) {
|
||||
SILOptFunctionBuilder FunctionBuilder(*getPassManager());
|
||||
DeadInstructionSet DeadApplies;
|
||||
llvm::SmallSetVector<SILInstruction *, 8> Applies;
|
||||
OptRemark::Emitter ORE(DEBUG_TYPE, F.getModule());
|
||||
@@ -101,7 +103,8 @@ bool GenericSpecializer::specializeAppliesInFunction(SILFunction &F) {
|
||||
// We have a call that can potentially be specialized, so
|
||||
// attempt to do so.
|
||||
llvm::SmallVector<SILFunction *, 2> NewFunctions;
|
||||
trySpecializeApplyOfGeneric(Apply, DeadApplies, NewFunctions, ORE);
|
||||
trySpecializeApplyOfGeneric(FunctionBuilder, Apply, DeadApplies,
|
||||
NewFunctions, ORE);
|
||||
|
||||
// Remove all the now-dead applies. We must do this immediately
|
||||
// rather than defer it in order to avoid problems with cloning
|
||||
|
||||
Reference in New Issue
Block a user