mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add a -gnone option that can negate a previous -g option.
The name -gnone was chosen by analogy with -O and -Onone. Like -O/-Onone, the last option on the command line wins. The immediate use case for this is because we want to be able to run the tests with -g injected into every command line, but some tests will fail when debug info is included. Those particular tests can be explicitly marked -gnone. rdar://problem/18636307 Swift SVN r22777
This commit is contained in:
@@ -892,14 +892,19 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
|
||||
StringRef ResourceDir) {
|
||||
using namespace options;
|
||||
|
||||
if (Args.hasArg(OPT_g)) {
|
||||
Opts.DebugInfo = true;
|
||||
ArgStringList RenderedArgs;
|
||||
for (auto A : Args)
|
||||
A->render(Args, RenderedArgs);
|
||||
CompilerInvocation::buildDWARFDebugFlags(Opts.DWARFDebugFlags,
|
||||
RenderedArgs, SDKPath,
|
||||
ResourceDir);
|
||||
if (const Arg *A = Args.getLastArg(OPT_g_Group)) {
|
||||
if (A->getOption().matches(OPT_g)) {
|
||||
Opts.DebugInfo = true;
|
||||
ArgStringList RenderedArgs;
|
||||
for (auto A : Args)
|
||||
A->render(Args, RenderedArgs);
|
||||
CompilerInvocation::buildDWARFDebugFlags(Opts.DWARFDebugFlags,
|
||||
RenderedArgs, SDKPath,
|
||||
ResourceDir);
|
||||
} else {
|
||||
assert(A->getOption().matches(options::OPT_gnone) &&
|
||||
"unknown -g<kind> option");
|
||||
}
|
||||
}
|
||||
|
||||
for (const Arg *A : make_range(Args.filtered_begin(OPT_l, OPT_framework),
|
||||
|
||||
Reference in New Issue
Block a user