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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user