mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Swift SIL: make Function.name and GlobalVariable.name return a StringRef and not a String
and introduce the StringRef struct. It's more efficient. Also, rename the `HasName` protocol to `HasShortDescription`, which introduces the new requirement `shortDescription`. This is need because `name` now has `StringRef` type and not `String` anymore
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
import Basic
|
||||
import SILBridging
|
||||
|
||||
final public class BasicBlock : ListNode, CustomStringConvertible, HasName {
|
||||
final public class BasicBlock : ListNode, CustomStringConvertible, HasShortDescription {
|
||||
public var next: BasicBlock? { SILBasicBlock_next(bridged).block }
|
||||
public var previous: BasicBlock? { SILBasicBlock_previous(bridged).block }
|
||||
|
||||
@@ -28,6 +28,7 @@ final public class BasicBlock : ListNode, CustomStringConvertible, HasName {
|
||||
var s = SILBasicBlock_debugDescription(bridged)
|
||||
return String(cString: s.c_str())
|
||||
}
|
||||
public var shortDescription: String { name }
|
||||
|
||||
public var arguments: ArgumentArray { ArgumentArray(block: self) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user