Skip to content

Commit f227952

Browse files
committed
[SIL Optimizer] Eliminate some uses of SubstitutionList for debug output.
1 parent d457f1c commit f227952

File tree

2 files changed

+5
-27
lines changed

2 files changed

+5
-27
lines changed

include/swift/SILOptimizer/Utils/Generics.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -206,26 +206,14 @@ class ReabstractionInfo {
206206
return SpecializedGenericSig;
207207
}
208208

209-
SubstitutionList getCallerParamSubstitutions() const {
210-
return CallerParamSubMap.toList();
211-
}
212-
213209
SubstitutionMap getCallerParamSubstitutionMap() const {
214210
return CallerParamSubMap;
215211
}
216212

217-
SubstitutionList getClonerParamSubstitutions() const {
218-
return ClonerParamSubMap.toList();
219-
}
220-
221213
SubstitutionMap getClonerParamSubstitutionMap() const {
222214
return ClonerParamSubMap;
223215
}
224216

225-
SubstitutionList getCalleeParamSubstitutions() const {
226-
return CalleeParamSubMap.toList();
227-
}
228-
229217
SubstitutionMap getCalleeParamSubstitutionMap() const {
230218
return CalleeParamSubMap;
231219
}

lib/SILOptimizer/Utils/Generics.cpp

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -557,15 +557,12 @@ ReabstractionInfo::ReabstractionInfo(ApplySite Apply, SILFunction *Callee,
557557
if (SpecializedSubstFnTy != SpecializedCalleeSubstFnTy) {
558558
llvm::dbgs() << "SpecializedFnTy:\n" << SpecializedFnTy << "\n";
559559
llvm::dbgs() << "SpecializedSubstFnTy:\n" << SpecializedSubstFnTy << "\n";
560-
for (auto Sub : getCallerParamSubstitutions()) {
561-
llvm::dbgs() << "Sub:\n";
562-
Sub.dump();
563-
}
560+
getCallerParamSubstitutionMap().getCanonical().dump(llvm::dbgs());
564561
llvm::dbgs() << "\n\n";
565562

566563
llvm::dbgs() << "CalleeFnTy:\n" << CalleeFnTy << "\n";
567564
llvm::dbgs() << "SpecializedCalleeSubstFnTy:\n" << SpecializedCalleeSubstFnTy << "\n";
568-
ParamSubs.dump(llvm::dbgs());
565+
ParamSubs.getCanonical().dump(llvm::dbgs());
569566
llvm::dbgs() << "\n\n";
570567
assert(SpecializedSubstFnTy == SpecializedCalleeSubstFnTy &&
571568
"Substituted function types should be the same");
@@ -595,20 +592,13 @@ ReabstractionInfo::ReabstractionInfo(ApplySite Apply, SILFunction *Callee,
595592
llvm::dbgs() << "Callee generic function type:\n"
596593
<< Callee->getLoweredFunctionType() << "\n\n";
597594
llvm::dbgs() << "Callee's call substitution:\n";
598-
for (auto Sub : getCalleeParamSubstitutions()) {
599-
llvm::dbgs() << "Sub:\n";
600-
Sub.dump();
601-
llvm::dbgs() << "\n";
602-
}
595+
getCalleeParamSubstitutionMap().getCanonical().dump(llvm::dbgs());
603596

604597
llvm::dbgs() << "Partially specialized generic function type:\n"
605598
<< getSpecializedType() << "\n\n";
606599
llvm::dbgs() << "\nSpecialization call substitution:\n";
607-
for (auto Sub : getCallerParamSubstitutions()) {
608-
llvm::dbgs() << "Sub:\n";
609-
Sub.dump();
610-
llvm::dbgs() << "\n";
611-
});
600+
getCallerParamSubstitutionMap().getCanonical().dump(llvm::dbgs());
601+
);
612602
}
613603
}
614604

0 commit comments

Comments
 (0)