Commit Graph

20 Commits

Author SHA1 Message Date
Erik Eckstein
27dc5afb10 libswift: add a few utilities
* add the IntegerLiteralInst + the Builder function to create it
* add Value.nonDebugUses
* add a general utility Sequence.isEmpty
* add PassContext.replaceAllUses
* add a function to erase all `debug_value` uses in PassContext.erase
2021-11-29 09:41:05 +01:00
Erik Eckstein
99fb82952a libswift: don't use the internal C++ namespace
Because this can be different in various C++ libraries.

Fixes a build problem on Ubuntu 20.04
2021-11-04 20:03:06 +01:00
Erik Eckstein
78c4c3ff6d libswift: fixes for the linux bootstrapping build 2021-10-29 08:56:02 +02:00
Erik Eckstein
7849f09e52 SIL: remove the unused alloc_value_buffer, project_value_buffer and dealloc_value_buffer instructions.
Those instructions were use for the materializeForSet implementation, which was replaced by modify-coroutines.
2021-10-07 07:41:54 +02:00
Erik Eckstein
fc772fff50 libswift: add more instructions and other small utilities
* ApplySite.arguments
* BasicBlock != operator
* some Function argument related properties
* Operand.isTypeDependent
* Type.isTrivial
* bridging of raw_ostream::write
2021-09-24 11:36:41 +02:00
Zoe Carver
6300b8b4f8 Merge pull request #39356 from zoecarver/cxx-interop-lib-swift
[cxx-interop][libswift] Use `std::string` instead of `BridgedStringRef` 🚀
2021-09-23 15:06:19 -04:00
zoecarver
f063701f84 [cxx-interop][libswift] Use std::string instead of BridgedStringRef.
The first C-bridge to be removed! 🚀
2021-09-22 16:13:44 -07:00
Erik Eckstein
50195e7e7d libswift: fix a few bugs in StackList
Use MemoryLayout.stride instead pf MemoryLayout.size. This fixes a buffer overflow bug in case of unaligned elements.
Plus some other bug fixes for stacklists which get larger than a single slab.
Also, add the `append(contentsOf:)` method.
2021-09-20 07:56:46 +02:00
Min-Yih Hsu
343d842394 [SIL][DebugInfo] PATCH 3/3: Deprecate debug_value_addr SIL instruciton
This patch removes all references to DebugValueAddrInst class and
debug_value_addr instruction in textual SIL files.
2021-08-31 12:01:04 -07:00
Erik Eckstein
90c71ad002 libswift: improve and simplify pass invocation
* unify FunctionPassContext and InstructionPassContext
* add a modification API: PassContext.setOperand
* automatic invalidation notifications when the SIL is modified
2021-08-23 10:21:12 +02:00
Erik Eckstein
edf0ba0b6b libswift: add UseList.isSingleUse property 2021-08-23 10:21:12 +02:00
Erik Eckstein
56cfab2b55 libswift: add more instruction classes
And add `UnaryInstruction` which adds a property `operand` to all unary instructions.
This replaces the existing single-operand properties, which simplifies the code.
2021-08-23 10:21:12 +02:00
Erik Eckstein
030e3ef8a3 libswift: add singleDirectResult property to FullApplySite 2021-07-05 13:16:40 +02:00
Erik Eckstein
b175436d07 libswift: add instructions, support block predecessors/successors
Add many new instruction classes in libswift, including all terminator instructions.
This allows to support BasicBlock predecessors and successors.
2021-07-01 16:15:44 +02:00
Erik Eckstein
46c3a17e3d libswift: add Type.isAddress and Type.isObject 2021-07-01 15:23:08 +02:00
Erik Eckstein
891f53d1e3 libswift: bridge the MemoryBehavior enum instead of all the mayRead/Write instruction functions 2021-07-01 15:17:51 +02:00
Erik Eckstein
14422cdb50 libswift: Add the StackList data structure
StackList is a very efficient data structure for worklist type things.
This is a port of the C++ utility with the same name.

Compared to Array, it does not require any memory allocations.
2021-06-09 11:33:41 +02:00
Erik Eckstein
d49108da07 libswift: add the SIL Builder
And two example instruction building functions.
2021-06-09 11:31:06 +02:00
Erik Eckstein
8080465e77 libswift: basic SIL and SIL bridging
This is the initial version of a buildable SIL definition in libswift.
It defines an initial set of SIL classes, like Function, BasicBlock, Instruction, Argument, and a few instruction classes.
The interface between C++ and SIL is a bridging layer, implemented in C.
It contains all the required bridging data structures used to access various SIL data structures.
2021-06-09 11:28:57 +02:00
Erik Eckstein
809ce72e05 libswift: build support for the initial libswift
* add the (still empty) libswift package
* add build support for libswift in CMake
* add libswift to swift-frontend and sil-opt

The build can be controlled with the LIBSWIFT_BUILD_MODE cmake variable: by default it’s “DISABLE”, which means that libswift is not built. If it’s “HOSTTOOLS”, libswift is built with a pre-installed toolchain on the host system.
2021-06-09 11:25:15 +02:00