Allan Shortlidge
1ffe55b856
Revert "swift SIL: Fix variable 's' was never mutated; consider changing to 'let' constant warnings."
...
This reverts commit d83c17e832 .
2022-05-10 10:38:58 -07:00
Allan Shortlidge
d83c17e832
swift SIL: Fix variable 's' was never mutated; consider changing to 'let' constant warnings.
2022-05-06 17:29:12 -07:00
Egor Zhdan
145ed33482
[cxx-interop][SwiftCompilerSources] Use std::string instead of BridgedStringRef
...
This reverts commit 2900dec7
2022-05-03 19:48:14 +01:00
Erik Eckstein
325a0b1f48
swift SIL: add some Instruction, Value and Type APIs
...
* instructions `RefToBridgeObjectInst`, `BridgeObjectToWordInst`, `StringLiteralInst`, `ProjectBoxInst`, `InitEnumDataAddrInst`, `UncheckedTakeEnumDataAddrInst`, `InjectEnumAddrInst`
* protocols `StoringInstruction` and `EnumInstruction`
* load/store-weak/unowned instructions
* `CopyAddrInst.isTakeOfSrc/isInitializationOfDest`
* `ApplySite.calleeArgIndex/callerArgIndex`
* `SILValue.definingInstruction/definingBlock/function`
* `Type.isReferenceCounted`
* `FunctionArgument.isExclusiveIndirectParameter`
* support `CondBranchInst` in `incomingPhiValues`
2022-03-30 14:45:58 +02:00
Rintaro Ishizaki
7486cd1c21
[SwiftCompiler] Move common bridging facilities to 'Basic'
...
A preparation for AST/DiagnosticEngine bridging
2022-02-20 22:06:39 -08:00
Erik Eckstein
603e837a8f
Swift optimizations: make isSwift51RuntimeAvailable sensitive to the resilience domain of the function.
2022-01-27 13:20:38 +01:00
Erik Eckstein
f09dfc93a9
Swift SIL: escape effects for function arguments.
...
Store a list of argument effects in a function, which specify if and how arguments escape.
Such effects can be specified in the Swift source code (for details see docs/ReferenceGuides/UnderscoredAttributes.md) or derived in an optimization pass.
For details see the documentation in SwiftCompilerSources/Sources/SIL/Effects.swift.
2022-01-25 11:29:44 +01:00
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