Support build and target configurations

These changes add support for build and target configurations in the compiler.
Build and target configurations, combined with the use of #if/#else/#endif allow
for conditional compilation within declaration and statement contexts.

Build configurations can be passed into the compiler via the new '-D' flag, or
set within the LangOptions class. Target configurations are implicit, and
currently only "os" and "arch" are supported.

Swift SVN r14305
This commit is contained in:
Joe Pamer
2014-02-24 18:16:48 +00:00
parent fef36edc6b
commit f83f94d9d8
49 changed files with 933 additions and 38 deletions

View File

@@ -512,6 +512,11 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
Opts.DebugConstraintSolverAttempt = attempt;
}
for (const Arg *A : make_range(Args.filtered_begin(OPT_D),
Args.filtered_end())) {
Opts.BuildConfigOptions[A->getValue()] = A->getValue();
}
return false;
}