15 Commits

Author SHA1 Message Date
Anthony Latsis
58f957c99e unittests: Adjust code after changes to llvm::TrailingObjects API
See:
- https://github.com/llvm/llvm-project/pull/138970
- https://github.com/llvm/llvm-project/pull/144930
2025-07-22 06:47:45 +01:00
Marc Rasi
922fdfacc6 disable sized deallocation for TextOwner 2019-05-08 17:24:54 -07:00
Saleem Abdulrasool
3f5c245d7f Basic: correct use-after-move on Windows
The order of evaluation for arguments is underspecified in the language
specification.  It is permissible to evluate right to left, resulting in the use
after the move of the OwnedPtr.  This happens in practice on Windows.  Alter the
construction to avoid this.
2018-08-31 16:03:50 -07:00
Alex Hoppen
ac512d4341 [libSyntax] Add a reference counted version of OwnedString
We cannot use unowned strings for token texts of incrementally parsed
syntax trees since the source buffer to which reused nodes refer will
have been freed for reused nodes. Always copying the token text whenever
OwnedString is passed is too expensive. A reference counted copy of the
string allows us to keep the token's string alive across incremental
parses while eliminating unnecessary copies.
2018-08-13 15:37:53 -07:00
Alex Hoppen
60feeac01c [libSyntax] Copy the text of a syntax node
Since we are reusing syntax nodes as part of incremental parsing, we
cannot rely on the buffer always outliving the syntax nodes.
2018-07-18 13:35:10 -07:00
Mark Lacey
d8f492e5d7 Squelch some warnings.
Fix up some dead code warnings as well as a warning for testing
whether an unsigned number is non-negative (which it always is).
2017-12-10 15:21:19 -08:00
Xi Ge
e861d51ccf libSyntax: implement the rule of five for OwnedString to ensure correct memory management. rdar://35116413 (#12610)
Thank you! @jrose-apple
2017-10-25 09:59:58 -07:00
Xi Ge
844aeae2d5 Re-apply "libSyntax: create a basic infrastructure for generating libSyntax entities by using Parser." (#12538) 2017-10-20 22:58:28 -07:00
Greg Parker
48a6b9d464 Revert "libSyntax: create a basic infrastructure for generating libSyntax entities by using Parser."
This reverts commit ee7a06276d.
It causes build failures like "'swift/Syntax/SyntaxNodes.h' file not found".
2017-10-19 17:11:48 -07:00
Xi Ge
ee7a06276d libSyntax: create a basic infrastructure for generating libSyntax entities by using Parser. 2017-10-18 17:02:00 -07:00
practicalswift
246cfa6c16 [gardening] Use consistent headers 2017-02-24 09:37:37 +01:00
Hugh Bellamy
32260e6475 Merge pull request #7588 from hughbe/swiftSyntax-win32
Port swiftSyntax to Windows
2017-02-22 10:26:24 +07:00
practicalswift
e44af328fb [gardening] Fix incorrect Swift URLs. 2017-02-21 14:20:34 +01:00
Hugh Bellamy
b564a917be Port swiftSyntax to Windows 2017-02-21 08:24:56 +07:00
David Farler
7ee42994c8 Start the Syntax library and optional full token lexing
Add an option to the lexer to go back and get a list of "full"
tokens, which include their leading and trailing trivia, which
we can index into from SourceLocs in the current AST.

This starts the Syntax sublibrary, which will support structured
editing APIs. Some skeleton support and basic implementations are
in place for types and generics in the grammar. Yes, it's slightly
redundant with what we have right now. lib/AST conflates syntax
and semantics in the same place(s); this is a first step in changing
that to separate the two concepts for clarity and also to get closer
to incremental parsing and type-checking. The goal is to eventually
extract all of the syntactic information from lib/AST and change that
to be more of a semantic/symbolic model.

Stub out a Semantics manager. This ought to eventually be used as a hub
for encapsulating lazily computed semantic information for syntax nodes.
For the time being, it can serve as a temporary place for mapping from
Syntax nodes to semantically full lib/AST nodes.

This is still in a molten state - don't get too close, wear appropriate
proximity suits, etc.
2017-02-17 12:57:04 -08:00