Swift Bridging: use C++ instead of C bridging for BridgedBasicBlock

This commit is contained in:
Erik Eckstein
2023-03-17 11:35:28 +01:00
parent c0c0b80c81
commit c4f5bab5b7
8 changed files with 170 additions and 188 deletions

View File

@@ -104,7 +104,16 @@ extension Value {
/// True if the value has a trivial type which is and does not contain a Builtin.RawPointer.
public var hasTrivialNonPointerType: Bool { type.isTrivialNonPointer(in: parentFunction) }
public var ownership: Ownership { bridged.getOwnership().ownership }
public var ownership: Ownership {
switch bridged.getOwnership() {
case .Unowned: return .unowned
case .Owned: return .owned
case .Guaranteed: return .guaranteed
case .None: return .none
default:
fatalError("unsupported ownership")
}
}
public var hashable: HashableValue { ObjectIdentifier(self) }
@@ -198,16 +207,3 @@ final class PlaceholderValue : Value {
extension OptionalBridgedValue {
var value: Value? { obj.getAs(AnyObject.self) as? Value }
}
extension BridgedValue.Ownership {
var ownership: Ownership {
switch self {
case .Unowned: return .unowned
case .Owned: return .owned
case .Guaranteed: return .guaranteed
case .None: return .none
default:
fatalError("unsupported ownership")
}
}
}