mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Typed throws] IR generation and runtime support for function type metadata
Extend function type metadata with an entry for the thrown error type, so that thrown error types are represented at runtime as well. Note that this required the introduction of "extended" function type flags into function type metadata, because we would have used the last bit. Do so, and define one extended flag bit as representing typed throws. Add `swift_getExtendedFunctionTypeMetadata` to the runtime to build function types that have the extended flags and a thrown error type. Teach IR generation to call this function to form the metadata, when appropriate. Introduce all of the runtime mangling/demangling support needed for thrown error types.
This commit is contained in:
@@ -2811,6 +2811,8 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
|
||||
runtimeCompatibilityVersion = llvm::VersionTuple(5, 6);
|
||||
} else if (version.equals("5.8")) {
|
||||
runtimeCompatibilityVersion = llvm::VersionTuple(5, 8);
|
||||
} else if (version.equals("5.11")) {
|
||||
runtimeCompatibilityVersion = llvm::VersionTuple(5, 11);
|
||||
} else {
|
||||
Diags.diagnose(SourceLoc(), diag::error_invalid_arg_value,
|
||||
versionArg->getAsString(Args), version);
|
||||
|
||||
Reference in New Issue
Block a user