Commit Graph

15 Commits

Author SHA1 Message Date
Meghana Gupta
1985b6cceb [NFC] Add SerializationOptions to ASTContext 2024-10-31 13:40:56 -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
Evan Wilde
11fcbbeea2 Cleaning up more deprecation warnings
Pointer `llvm/Support/Host.h` at `llvm/TargetParser/Host.h`.
Replacing deprecated API `startswith_insensitive` with replacement
`starts_with_insensitive`.
2023-08-10 16:19:24 -07:00
Alex Hoppen
fe7878ecce [Serialization] Improve module loading performance
When looking for a Swift module on disk, we were scanning all module search paths if they contain the module we are searching for. In a setup where each module is contained in its own framework search path, this scaled quadratically with the number of modules being imported. E.g. a setup with 100 modules being imported form 100 module search paths could cause on the order of 10,000 checks of `FileSystem::exists`. While these checks are fairly fast (~10µs), they add up to ~100ms.

To improve this, perform a first scan of all module search paths and list the files they contain. From this, create a lookup map that maps filenames to the search paths they can be found in. E.g. for
```
searchPath1/
  Module1.framework

searchPath2/
  Module1.framework
  Module2.swiftmodule
```
we create the following lookup table
```
Module1.framework -> [searchPath1, searchPath2]
Module2.swiftmodule -> [searchPath2]
```
2021-12-14 12:44:13 +01:00
Meghana Gupta
f458d9b490 Fix unnecessary one-time recompile of stdlib with -enable-ossa-flag (#39516)
* Fix unnecessary one-time recompile of stdlib with -enable-ossa-flag

This includes a bit in the module format to represent if the module was
compiled with -enable-ossa-modules flag. When compiling a client module
with -enable-ossa-modules flag, all dependent modules are checked for this bit,
if not on, recompilation is triggered with -enable-ossa-modules.

* Updated tests
2021-10-04 18:46:40 -07:00
Victoria Mitchell
ff766fce37 add ASTContext symbol-graph arg in unit tests 2021-07-01 09:05:02 -06:00
Pavel Yaskevich
df7af0078f [CSBindings] Separate inference storage from final product usable by the solver
`PotentialBindings` lost most of its responsibilities,
and are no longer comparable. Their main purpose now
is binding and metadata tracking (introduction/retraction).

New `BindingSet` type is something that represents a set
of bindings at the current step of the solver.
2021-02-24 10:37:20 -08:00
Pavel Yaskevich
72888ca29b [ConstraintSystem] NFC: Extract PotentialBindings and auxiliary struct from ConstraintSystem
This opens up a posibility of using `PotentialBindings`
in `ConstraintGraphNode` and other places in `ConstraintGraph`.
2021-01-15 15:03:54 -08:00
Frederick Kellison-Linn
6b0f5da001 [Unit tests] Add unit tests for optional lookup behavior 2020-12-04 12:11:10 -05:00
Pavel Yaskevich
a3c3981a68 [unittest/Sema] NFC: Add a way to create a protocol with a given name and parent type 2020-10-15 16:27:36 -07:00
Pavel Yaskevich
1aecea17e4 [unittest/Sema] Add a helper method to infer bindings for a given type variable
This mimics what `determineBestBindings` does but without sorting.
2020-10-15 16:27:35 -07:00
Pavel Yaskevich
fde1af756d [unittest/Sema] Use default target triple to fix Windows build 2020-10-13 13:52:24 -07:00
Pavel Yaskevich
b2c31c394b [unittests/Sema] Add an ability to retrieve stdlib types by name 2020-10-12 18:57:20 -07:00
Pavel Yaskevich
0b22d91c94 [unittests] Extend Sema testing fixture to load stdlib (+ shims)
Setup module importers, load stdlib, establish separate testing
module and load a single main file there which imports standard
library.
2020-10-12 18:57:20 -07:00
Pavel Yaskevich
9239692d00 [unittests] Add a fixture for Sema unit tests 2020-10-12 18:57:20 -07:00