[GSB] Add verification of all generic signatures within a module.

Add a verification pass to ensure that all of the generic signatures in
a module are both minimal and canonical. The approach taken is quite
direct: for every (canonical) generic signature in the module, try
removing a single requirement and forming a new generic signature from
the result. If that new generic signature that provide the removed
requirement, then the original signature was not minimal.

Also canonicalize each resulting signature, to ensure that it meets the
requirements for a canonical signature.

Add a test to ensure that all of the generic signatures in the Swift
module are minimal and canonical, since they are ABI.
This commit is contained in:
Doug Gregor
2017-11-07 15:20:38 -08:00
parent b1aa23a222
commit 5d5e6122f3
7 changed files with 111 additions and 1 deletions

View File

@@ -229,6 +229,10 @@ static bool ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
Opts.ParseStdlib |= Args.hasArg(OPT_parse_stdlib);
if (const Arg *A = Args.getLastArg(OPT_verify_generic_signatures)) {
Opts.VerifyGenericSignaturesInModule = A->getValue();
}
// Determine what the user has asked the frontend to do.
FrontendOptions::ActionType &Action = Opts.RequestedAction;
if (const Arg *A = Args.getLastArg(OPT_modes_Group)) {