Commit Graph

6 Commits

Author SHA1 Message Date
Erik Eckstein
cec4b82b39 swift SIL: add some SIL type related bridging
* `Function.argumentTypes` and `Function.resultType`
* `Type.isNominal`, `Type.isClass`, `Type.isTuple`, `Type.isStruct` and `Type.isEnum`
* `Type.getFieldIndexOfNominal`
* `Type.getFieldTypeOfNominal`
* `Type.tupleElements`
* `Type.description` for better debugging

# Conflicts:
#	SwiftCompilerSources/Sources/SIL/Type.swift
#	SwiftCompilerSources/Sources/SIL/Utils.swift
#	SwiftCompilerSources/Sources/SIL/Value.swift
#	include/swift/SIL/SILBridging.h
#	lib/SIL/Utils/SILBridging.cpp
2022-01-19 18:51:19 +00:00
Max Desiatov
7d961001d3 libswift: bridge more functions from SILBuilder 2022-01-19 18:51:18 +00:00
Max Desiatov
f2aefad246 libswift: clean up SIL/Function.swift formatting 2022-01-19 18:51:18 +00:00
Erik Eckstein
345fcbe39a Improve collections in the swift SIL/Optimizer
Improve block/instruction lists and similar collections

* pretty print collections in the form “[a, b, c]”
* also do this for lazy sequences
* define a custom Mirror
* in a collection, only print the name of blocks, functions and globals (instead of the full object)
* replace `BasicBlock.reverseInstructions` with `BasicBlock.instructions.reversed()` - in an efficient way
2022-01-12 15:47:16 +01:00
Erik Eckstein
24b62d4d7c Swift SIL: add a few utilities and instructions
* instructions: function_ref, mark_dependence
* add `BuiltinInst.id`
* add isObjC and canAllocOnStack for alloc_ref and alloc_ref_dynamic
* add `ApplySite::referencedFunction`
* add `Builder.createDeallocStackRef`
* add == and != operators for `Function`
* add `List.first` and `ReverseList.first`
2022-01-12 15:47:15 +01:00
Erik Eckstein
4beb94c2f9 Rename the libswift directory to SwiftCompilerSources 2021-12-22 09:46:25 +01:00