SIL symbol visitation wasn't visiting top-level auxiliary declarations,
which meant that it skipped peer and freestanding macros at module
scope. This would manifest in errors of the form
<symbol> is in the generated IR file, but not in TBD file
Fixes rdar://107426276.
A new `RuntimeAttributeGenerator` is used to reference runtime
attribute generator functions synthesized by SILGen.
`#function` magic literal points to the declaration that declaration
attribute is attached to.
This attribute indicates that the given SILFunction has to be
added to "accessible functions" section and could be looked up
at runtime using a special API.
`getValue` -> `value`
`getValueOr` -> `value_or`
`hasValue` -> `has_value`
`map` -> `transform`
The old API will be deprecated in the rebranch.
To avoid merge conflicts, use the new API already in the main branch.
rdar://102362022
Although the declaration of macros doesn't appear in Swift source code
that uses macros, they still operate as declarations within the
language. Rework `Macro` as `MacroDecl`, a generic value declaration,
which appropriate models its place in the language.
The vast majority of this change is in extending all of the various
switches on declaration kinds to account for macros.
TBD files contain a section reserved for obj-c classes. Previously,
TBDGen was adding symbols with this + normal globals with objc class
prefixes. This patch removes the extra globals being added.
This also accounts for this behavior for `validate-tbd-against-ir`
checking.
Resolves: rdar://101442087
Previously, dispatch thunks and method descriptors were only emitted when visiting the containing `ClassDecl`. IRGen for `#_hasSymbol` requires visiting the `FuncDecl` directly.