mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Function-level optimization attributes.
For now these are underscored attributes, i.e. compiler internal attributes:
@_optimize(speed)
@_optimize(size)
@_optimize(none)
Those attributes override the command-line specified optimization mode for a specific function.
The @_optimize(none) attribute is equivalent to the already existing @_semantics("optimize.sil.never") attribute
This commit is contained in:
@@ -2236,6 +2236,14 @@ void Serializer::writeDeclAttribute(const DeclAttribute *DA) {
|
||||
return;
|
||||
}
|
||||
|
||||
case DAK_Optimize: {
|
||||
auto *theAttr = cast<OptimizeAttr>(DA);
|
||||
auto abbrCode = DeclTypeAbbrCodes[OptimizeDeclAttrLayout::Code];
|
||||
OptimizeDeclAttrLayout::emitRecord(Out, ScratchRecord, abbrCode,
|
||||
(unsigned)theAttr->getMode());
|
||||
return;
|
||||
}
|
||||
|
||||
case DAK_Effects: {
|
||||
auto *theAttr = cast<EffectsAttr>(DA);
|
||||
auto abbrCode = DeclTypeAbbrCodes[EffectsDeclAttrLayout::Code];
|
||||
|
||||
Reference in New Issue
Block a user