SIL: Introduce SILLinkage::PublicNonABI

This is going to be used for "always emit into client" functions,
such as default argument generators and stored property
initializers.

- In dead function elimination, these functions behave identically to
  public functions, serving as "anchors" for the mark-and-sweep
  analysis.

- There is no external variant of this linkage, because external
  declarations can use HiddenExternal linkage -- the definition should
  always be emitted by another translation unit in the same Swift
  module.

- When deserialized, they receive shared linkage, because we want the
  linker to coalesce multiple copies of the same deserialized
  definition if it was deserialized from multiple translation units
  in the same Swift module.

- When IRGen emits a definition with this linkage, it receives the
  same LLVM-level linkage as a hidden definition, ensuring it does not
  have a public entry point.
This commit is contained in:
Slava Pestov
2018-01-13 19:19:52 -08:00
parent 241c5e89bd
commit c857a480e1
16 changed files with 165 additions and 40 deletions

View File

@@ -54,7 +54,7 @@ const uint16_t VERSION_MAJOR = 0;
/// in source control, you should also update the comment to briefly
/// describe what change you made. The content of this comment isn't important;
/// it just ensures a conflict if two people change the module format.
const uint16_t VERSION_MINOR = 392; // Last change: accessor decls
const uint16_t VERSION_MINOR = 393; // SILLinkage::PublicNonABI
using DeclIDField = BCFixed<31>;