Commit Graph

11 Commits

Author SHA1 Message Date
Meghana Gupta
1985b6cceb [NFC] Add SerializationOptions to ASTContext 2024-10-31 13:40:56 -07:00
Ben Barham
1fdda023b3 Rename StringRef::endswith references to StringRef::ends_with
Missed this when doing the `startswith` renaming. `endswith` has also
been deprecated upstream (and presumably soon to be removed).
2024-04-01 10:59:16 -07:00
Steven Wu
3986937e03 [Caching][NFC] Restructure CASOption in swift. NFC
Clean up how CASOptions are kept and passed inside swift to make the
code more readable. Also avoid a copy of CAS configuration in
ClangImporter.
2024-02-11 14:08:09 -08:00
Ben Barham
d51c58a6f9 [Basic] hasFeature should succeed for promoted language features
Merge `$<Feature>` and `hasFeature` implementations.
  - `$<Feature>` did not support upcoming language features.
  - `hasFeature` did not support promoted language features and also
    didn't take into account `Options` in `Features.def`.

Remove `Options` entirely, it was always one of three cases:
  - `true`
  - `langOpts.hasFeature`
  - `hasSwiftSwiftParser`

Since `LangOptions::hasFeature` should always be used anyway, it's no
longer necessary. `hasSwiftSwiftParser` can be special cased when adding
the default promoted language features (by removing those features).

Resolves rdar://117917456.
2024-01-05 10:26:13 -08:00
Rintaro Ishizaki
636df870ef [swift-parse-test] Remove unused static function
appendToVector was a leftover form earlier development, and not used.
2023-11-13 16:10:12 -08:00
Rintaro Ishizaki
fb08a92f48 [ASTGen] Infrastructure to implment ASTGen Incrementally
* 'ASTGenVisitor' has a reference to a legacy C++ Parser configured for
  ASTGen.
* If 'ASTGenVisitor' encounters a AST node that hasn't been migrated,
  call parse(Decl|Stmt|Expr|Type) to parse the position using the legacy
  parser.
* The legacy parser calls ASTGen's
  'swift_ASTGen_build(Decl|Stmt|Expr|Type)' for each ASTNode "parsing"
  (unless the call is not directly from the ASTGen.)

rdar://117151886
2023-11-12 21:43:08 -08:00
Saleem Abdulrasool
8caa60cefa Update swift_parse_test_main.cpp
Add missing `;`
2023-11-05 11:37:33 -08:00
Rintaro Ishizaki
cb5fd7db7b [swift-parse-test] Tweak for review
* 'iteration' -> 'iterations'
* Comment to clarify cpu time vs wall clock time
* Return 'Error' from the executors
2023-11-03 15:43:09 -07:00
Rintaro Ishizaki
024726f1f1 [swift-parse-test] Dont show throughput if it the elasped time is zero
Fix division by zero.

rdar://117750086
2023-11-03 09:47:29 -07:00
Rintaro Ishizaki
66b8946eb4 [swift-parse-test] Add -skip-bodies option
This is no-op for SwiftParser. Also add a sanity check test file.
2023-10-30 13:18:04 -07:00
Rintaro Ishizaki
e01df929c2 [swift-parse-test] A parser performance check utility
```
% swift-parse-test -swift-parser -lib-parse -n 20 ../swift-syntax/Sources
files count: 228
total bytes: 5662399
total lines: 158428
iteration: 20
----
parser:  SwiftParser
wall clock time (ms): 3848
cpu time (ms): 3843
throughput (byte/sec): 355824
throughput (line/sec): 41225
----
parser:  libParse
wall clock time (ms): 296
cpu time (ms): 290
throughput (byte/sec): 4715281
throughput (line/sec): 546303
```
2023-10-28 20:23:26 -07:00