Remove AssertDebug hack and fixup make files

When we build the standard libary with -parse-stdlib the frontend sets the
assert configuration to 'DisableReplacement'. Constant replacement does not take
place and the call to the builtin function 'assert_configuration' call stays in
the serialize SIL of the swiftmodule.

IRGen replaces the function call to the assert_configuration builtin function by
the value for Debug (0). The resuling standard library dylib hence contains the
debug version of the standard library assert function.

Frontend optimization flags can now determine whether asserts should be executed
or not.

This commit removes the SWIFT_ASSERTS cmake flag.

rdar://16458612

Swift SVN r16473
This commit is contained in:
Arnold Schwaighofer
2014-04-17 22:05:43 +00:00
parent 989d554a45
commit 45ffb41adf
5 changed files with 8 additions and 43 deletions

View File

@@ -641,6 +641,7 @@ static void PrintArg(raw_ostream &OS, const char *Arg, bool Quote) {
static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
IRGenOptions &IRGenOpts,
FrontendOptions &FEOpts,
DiagnosticEngine &Diags) {
using namespace options;
@@ -715,6 +716,10 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
A->getAsString(Args), A->getValue());
return true;
}
} else if (FEOpts.ParseStdlib) {
// Disable assertion configuration replacement when we build the standard
// library.
Opts.AssertConfig = SILOptions::DisableReplacement;
} else {
// Set the assert configuration according to the optimization level.
Opts.AssertConfig =
@@ -879,7 +884,7 @@ bool CompilerInvocation::parseArgs(ArrayRef<const char *> Args,
return true;
}
if (ParseSILArgs(SILOpts, *ParsedArgs, IRGenOpts, Diags)) {
if (ParseSILArgs(SILOpts, *ParsedArgs, IRGenOpts, FrontendOpts, Diags)) {
return true;
}