diff options
author | Tim Northover <t.p.northover@gmail.com> | 2021-01-20 10:14:03 +0000 |
---|---|---|
committer | Tim Northover <t.p.northover@gmail.com> | 2021-05-14 11:43:58 +0100 |
commit | ea0eec69f16e0f1b00fec413986e4e44f6f627fa (patch) | |
tree | 4fdaa3d71b5910e637de6d7ecce32ea37bdedb83 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | 079bbea2b20dbfd24e4df654bae1c4324dcde754 (diff) | |
download | llvm-ea0eec69f16e0f1b00fec413986e4e44f6f627fa.zip llvm-ea0eec69f16e0f1b00fec413986e4e44f6f627fa.tar.gz llvm-ea0eec69f16e0f1b00fec413986e4e44f6f627fa.tar.bz2 |
IR+AArch64: add a "swiftasync" argument attribute.
This extends any frame record created in the function to include that
parameter, passed in X22.
The new record looks like [X22, FP, LR] in memory, and FP is stored with 0b0001
in bits 63:60 (CodeGen assumes they are 0b0000 in normal operation). The effect
of this is that tools walking the stack should expect to see one of three
values there:
* 0b0000 => a normal, non-extended record with just [FP, LR]
* 0b0001 => the extended record [X22, FP, LR]
* 0b1111 => kernel space, and a non-extended record.
All other values are currently reserved.
If compiling for arm64e this context pointer is address-discriminated with the
discriminator 0xc31a and the DB (process-specific) key.
There is also an "i8** @llvm.swift.async.context.addr()" intrinsic providing
front-ends access to this slot (and forcing its creation initialized to nullptr
if necessary).
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 50fb3d4..c5ff561 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -736,6 +736,8 @@ static uint64_t getAttrKindEncoding(Attribute::AttrKind Kind) { return bitc::ATTR_KIND_SWIFT_ERROR; case Attribute::SwiftSelf: return bitc::ATTR_KIND_SWIFT_SELF; + case Attribute::SwiftAsync: + return bitc::ATTR_KIND_SWIFT_ASYNC; case Attribute::UWTable: return bitc::ATTR_KIND_UW_TABLE; case Attribute::VScaleRange: |