-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2cff728
commit ded5aa2
Showing
12 changed files
with
283 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
Generator/Sources/ProjectionModel/SwiftProjection+abi.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import CodeWriters | ||
import DotNetMetadata | ||
import WindowsMetadata | ||
|
||
extension SwiftProjection { | ||
public func toABIType(_ type: BoundType) throws -> SwiftType { | ||
precondition(!(type.definition is ClassDefinition)) // Classes have no ABI representation | ||
return .chain(abiModuleName, try CAbi.mangleName(type: type)) | ||
} | ||
|
||
public func toABIVirtualTableType(_ type: BoundType) throws -> SwiftType { | ||
precondition(type.definition is InterfaceDefinition || type.definition is DelegateDefinition) | ||
return .chain(abiModuleName, try CAbi.mangleName(type: type) + CAbi.virtualTableSuffix) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.