[embedded] Add a frontend flag to drop all code from a module and emit an empty object file

This commit is contained in:
Kuba Mracek
2024-03-28 11:03:50 -07:00
parent 2f44b0aa93
commit 90e7595df5
12 changed files with 118 additions and 1 deletions

View File

@@ -2185,6 +2185,10 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
FEOpts.RequestedAction == FrontendOptions::ActionType::CompileModuleFromInterface)
Opts.StopOptimizationAfterSerialization = true;
if (Args.getLastArg(OPT_emit_empty_object_file)) {
Opts.DropAllSILAfterSerialization = true;
}
// Propagate the typechecker's understanding of
// -experimental-skip-*-function-bodies to SIL.
Opts.SkipFunctionBodies = TCOpts.SkipFunctionBodies;