mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Change driver logic for sanitizers support.
With this patch different sanitizers (tsan/asan) will be enabled or disabled on the driver level on a particular OS depending on whether the required library is present. The current patch only supports Darwin architectures, but Linux support should not be hard to add.
This commit is contained in:
@@ -1420,7 +1420,14 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
|
||||
}
|
||||
|
||||
if (const Arg *A = Args.getLastArg(options::OPT_sanitize_EQ)) {
|
||||
Opts.Sanitize = parseSanitizerArgValues(A, Triple, Diags);
|
||||
Opts.Sanitize = parseSanitizerArgValues(
|
||||
A, Triple, Diags,
|
||||
/* sanitizerRuntimeLibExists= */[&](const StringRef libName) {
|
||||
|
||||
// The driver has checked the existance of the library
|
||||
// already.
|
||||
return true;
|
||||
});
|
||||
IRGenOpts.Sanitize = Opts.Sanitize;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user