Enum element default arguments is a recent addition to the language.
With -enable-testing, default arguments can have public linkage.
Fixes <rdar://problem/53948283>.
`@_silgen_name` functions with no body are forward-declarations of
existing symbols, only to appease the typechecker. They don't show up in
the IR, so don't add them to the TBD file.
Actually looking at the dumped IR is usually not interesting, the tests just
need to get to that stage to be able to perform the validation
correctly. Additionally, the IR is very large for some of these tests, so
dumping it makes things sllooooowww when something fails.
Also, bail out before emitting any default argument generators in Swift 4
mode. This is NFC, because we already check the linkage of the SILDeclRef
and skip it if its not public. But adding the check explicitly here
serves as a reminder that this entire code block can be deleted if we
ever decide to kill off Swift 3 compatibility.
It can now:
- not validate (=none)
- validate that all symbols in the IR are also in the TBD (=missing),
- validate the above, and also that all in the TBD are in the IR (=all).
The first and last were switched between with the old boolean flag, the
second is new.