mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[frontend] Added support for the -use-malloc flag.
Added a new static ParseLangArgs, which fills in a LangOptions object. Also moved the handling of -debug-constraints out of the loop in CompilerInvocation::parseArgs() and into ParseLangArgs, now that it has a proper home. Swift SVN r11172
This commit is contained in:
@@ -63,6 +63,21 @@ static bool ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
DiagnosticEngine &Diags) {
|
||||
using namespace options;
|
||||
|
||||
if (Args.hasArg(OPT_use_malloc)) {
|
||||
Opts.UseMalloc = true;
|
||||
}
|
||||
|
||||
if (Args.hasArg(OPT_debug_constraints)) {
|
||||
Opts.DebugConstraintSolver = true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CompilerInvocation::parseArgs(ArrayRef<const char *> Args,
|
||||
DiagnosticEngine &Diags) {
|
||||
using namespace driver::options;
|
||||
@@ -97,6 +112,10 @@ bool CompilerInvocation::parseArgs(ArrayRef<const char *> Args,
|
||||
return true;
|
||||
}
|
||||
|
||||
if (ParseLangArgs(LangOpts, *ParsedArgs, Diags)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (auto InputArg : *ParsedArgs) {
|
||||
switch (InputArg->getOption().getID()) {
|
||||
case OPT_target:
|
||||
@@ -131,10 +150,6 @@ bool CompilerInvocation::parseArgs(ArrayRef<const char *> Args,
|
||||
ExtraClangArgs.push_back(InputArg->getValue());
|
||||
break;
|
||||
|
||||
case OPT_debug_constraints:
|
||||
LangOpts.DebugConstraintSolver = true;
|
||||
break;
|
||||
|
||||
case OPT_l:
|
||||
addLinkLibrary(InputArg->getValue(), LibraryKind::Library);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user