[SIL] Add flag to SILFunction to indicate async.

Includes boilerplate to parse and print as well as to serialize and
deserialize.
This commit is contained in:
Nate Chandler
2020-08-03 17:28:34 -07:00
parent b647245fb8
commit 6b28c2fe89
12 changed files with 82 additions and 24 deletions

View File

@@ -274,6 +274,9 @@ private:
/// that it may have unboxed capture (i.e. @inout_aliasable parameters).
unsigned IsWithoutActuallyEscapingThunk : 1;
/// True if this function is an async function.
unsigned IsAsync : 1;
/// If != OptimizationMode::NotSet, the optimization mode specified with an
/// function attribute.
unsigned OptMode : NumOptimizationModeBits;
@@ -501,6 +504,10 @@ public:
IsWithoutActuallyEscapingThunk = val;
}
bool isAsync() const { return IsAsync; }
void setAsync(bool val = true) { IsAsync = val; }
/// Returns the calling convention used by this entry point.
SILFunctionTypeRepresentation getRepresentation() const {
return getLoweredFunctionType()->getRepresentation();