[Sema] Suppress warning about useless availability checks in playgrounds and immediate mode.

We normally report a warning when a #available() check will always be true
because of the minimum deployment target. These warnings are potentially
annoying when the developer either cannot change the minimum deployment target
from the default (as in playgrounds) or when doing so is burdensome (as for
interpreted command-line scripts, which would require passing a target triple)
-- so suppress them.

The is a updated version of the reverted r29582, which didn't check for
immediate mode properly.

rdar://problem/21324005

Swift SVN r29646
This commit is contained in:
Devin Coughlin
2015-06-24 23:09:22 +00:00
parent 786141fbef
commit 3e96e1f06b
5 changed files with 96 additions and 28 deletions

View File

@@ -406,6 +406,9 @@ void CompilerInstance::performSema() {
if (Invocation.getFrontendOptions().DebugTimeFunctionBodies) {
TypeCheckOptions |= TypeCheckingFlags::DebugTimeFunctionBodies;
}
if (Invocation.getFrontendOptions().actionIsImmediate()) {
TypeCheckOptions |= TypeCheckingFlags::ForImmediateMode;
}
// Parse the main file last.
if (MainBufferID != NO_SUCH_BUFFER) {