Add -strip-field-names and -strip-field-metadata IRGen options

This controls emission of field metadata for reflection, providing
the default decision. We might want to explore finer-grained
control per type, likely as a source code annotation.

  -strip-field-names
    Strip field names from nominal type metadata.

  -strip-field-metadata
    Strip all field metadata for nominal types. This also implies
    -strip-field-names.

NFC yet.
This commit is contained in:
David Farler
2016-01-22 21:09:46 -08:00
parent b8bac20bec
commit bb2391adbd
3 changed files with 24 additions and 2 deletions

View File

@@ -1204,6 +1204,15 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
}
}
if (Args.hasArg(OPT_strip_field_names)) {
Opts.StripFieldNames = true;
}
if (Args.hasArg(OPT_strip_field_metadata)) {
Opts.StripFieldMetadata = true;
Opts.StripFieldNames = true;
}
return false;
}