mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[generic-spec] Add an option -sil-generic-dump-functions-after-specialization that makes it easy to look for errors around specialization.
This commit is contained in:
@@ -67,6 +67,9 @@ llvm::cl::opt<bool> VerifyFunctionsAfterSpecialization(
|
||||
"Verify functions after they are specialized "
|
||||
"'PrettyStackTraceFunction'-ing the original function if we fail."));
|
||||
|
||||
llvm::cl::opt<bool> DumpFunctionsAfterSpecialization(
|
||||
"sil-generic-dump-functions-after-specialization", llvm::cl::init(false));
|
||||
|
||||
static bool OptimizeGenericSubstitutions = false;
|
||||
|
||||
/// Max depth of a type which can be processed by the generic
|
||||
@@ -2115,6 +2118,13 @@ GenericFuncSpecializer::tryCreateSpecialization(bool forcePrespecialization) {
|
||||
SpecializedF->verify();
|
||||
}
|
||||
|
||||
if (DumpFunctionsAfterSpecialization) {
|
||||
llvm::dbgs() << llvm::Twine("Generic function: ") + GenericFunc->getName() +
|
||||
". Specialized Function: " + SpecializedF->getName();
|
||||
GenericFunc->dump();
|
||||
SpecializedF->dump();
|
||||
}
|
||||
|
||||
return SpecializedF;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user