The two sides of an if-expr can't have counts that add up to more than
the count of the if-expr.
This was exposed by https://reviews.llvm.org/D85036.
rdar://66642166
Assign separate SILProfiler instances to stored property initializers
and constructors.
Starting with rdar://39460313, coverage reporting for these constructs
was bundled up into a single SILProfiler uniqued by the NominalTypeDecl.
There are two problems with doing this.
First, the shared SILProfiler is given a fake name that can't be
demangled. That breaks Xcode's reports. Second, the relationship
between SILProfiler and SILFunction is supposed to be 1:1. Having a
shared SILProfiler muddies things a bit and requires extra bookkeeping.
rdar://47467864
A SIL function that's initially only emitted as a declaration may later
be prepared for definition. When this happens, set up a profiler for the
definition.
This makes code coverage visible for private methods (the frontend
follows a declare-then-define pattern for these).
rdar://47759243
Most of this is just "remember to specify the inputs and outputs on
the command line, so remote-run can see them". A bit is "prefix
environment variables with '%env-'". And the last few are "yeah,
this was never going to work in a remote environment".
In the few cases where I couldn't think of anything reasonable, I just
marked the test as "UNSUPPORTED: remote_run", a new "feature".
* Group tests for profiling instrumentation together, NFC
This will make it easier to test changes to the code coverage logic.
There are a handful of tests which relate to profiling which I have not
moved. These include tests for the driver and for the SIL optimizer. It
makes more sense to keep those tests where they are.
* Rename a test file, NFC
This file tests code coverage of primary files, so I've changed the name
of the file to reflect that.
* Simplify the check lines in a test, NFC
This file tests code coverage of closures. It had several check lines
which obscured the meaning of the test, and its check lines were in a
strange order.
Remove the extra checks and disable -emit-sorted-sil.