diff options
author | Manman Ren <manman.ren@gmail.com> | 2016-04-01 21:41:15 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2016-04-01 21:41:15 +0000 |
commit | 9bfd0d03e92d4bbb0ebf6171f5e0692edf9820c3 (patch) | |
tree | 9a24f292b9df7e108e4a60d458c5668a2409157d /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | a3d15f3a5e645e75093f2f5f2b2065bca396c16e (diff) | |
download | bcm5719-llvm-9bfd0d03e92d4bbb0ebf6171f5e0692edf9820c3.tar.gz bcm5719-llvm-9bfd0d03e92d4bbb0ebf6171f5e0692edf9820c3.zip |
Swift Calling Convention: add swifterror attribute.
A ``swifterror`` attribute can be applied to a function parameter or an
AllocaInst.
This commit does not include any target-specific change. The target-specific
optimization will come as a follow-up patch.
Differential Revision: http://reviews.llvm.org/D18092
llvm-svn: 265189
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 18fb7ad8d11..84bdd8ca2e0 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -261,6 +261,8 @@ static uint64_t getAttrKindEncoding(Attribute::AttrKind Kind) { return bitc::ATTR_KIND_SANITIZE_THREAD; case Attribute::SanitizeMemory: return bitc::ATTR_KIND_SANITIZE_MEMORY; + case Attribute::SwiftError: + return bitc::ATTR_KIND_SWIFT_ERROR; case Attribute::SwiftSelf: return bitc::ATTR_KIND_SWIFT_SELF; case Attribute::UWTable: @@ -2142,8 +2144,7 @@ static void WriteInstruction(const Instruction &I, unsigned InstID, assert(AlignRecord < 1 << 5 && "alignment greater than 1 << 64"); AlignRecord |= AI.isUsedWithInAlloca() << 5; AlignRecord |= 1 << 6; - // Reserve bit 7 for SwiftError flag. - // AlignRecord |= AI.isSwiftError() << 7; + AlignRecord |= AI.isSwiftError() << 7; Vals.push_back(AlignRecord); break; } |