Commit Graph

237 Commits

Author SHA1 Message Date
David Ungar
396def8fd0 Shorted "createREPLFileWithImports" 2017-09-14 16:53:17 -07:00
David Ungar
9b2faa03dd Shorten fillInModulesToImportFromImplicitImportModuleNames 2017-09-14 16:53:16 -07:00
David Ungar
add13798be Separated out the Onone module handling from stdlib handling
Also refactored the Onone module predicate. I believe there is no functional change, but I don't understand the correctness of what was there.
2017-09-14 16:53:16 -07:00
David Ungar
249718e1bd Consolidate performWholeModuleTypeChecking and finishTypeCheckingMainModule into typeCheckMainModule 2017-09-14 16:53:16 -07:00
David Ungar
266007bee3 Don't pass clangImporter 2017-09-14 16:53:16 -07:00
David Ungar
8099209ddc Reify generateOutputForTheWholeModule 2017-09-14 16:53:16 -07:00
David Ungar
7fe7191a54 delete redundant "OnMainModule" from performWholeModuleTypeCheckingOnMainModule 2017-09-14 16:53:16 -07:00
David Ungar
2c08429e27 split up typeCheckTopLevelInputsExcludingMain
because the old name and code were just confusing to me

# Conflicts:
#	lib/Frontend/Frontend.cpp
2017-09-14 16:53:16 -07:00
David Ungar
e3a7857d77 Move comment to function declaration and renamed parseMainAndTypeCheckTopLevelFiles
# Conflicts:
#	lib/Frontend/Frontend.cpp
2017-09-14 16:50:55 -07:00
David Ungar
10b42c26b8 Addressing review suggestions
- Replaced RecursiveSharedTimer w/ SharedTimer in performTypeChecking
- Sorted includes by library name within top-level group
- Removed timer from addAdditionalImportsTo
- Changed comment to doc comment
- Unlinked computation of ImplicitModuleImportKind from creation of SIL module
- Renamed supplyREPLFileWithImports to createREPLFileWIthImports
- Reified tuple of ImplicitImports

# Conflicts:
#	lib/Frontend/Frontend.cpp
2017-09-14 16:49:39 -07:00
David Ungar
4c96b89b87 Fix a bug with DelayedCB 2017-09-14 16:46:37 -07:00
David Ungar
768586b3a0 Bug fix: loadStdlibAndMaybeSwiftOnoneSupport needs to be able to abort the compilation 2017-09-14 16:46:37 -07:00
David Ungar
d7a7a1e353 add some timers
# Conflicts:
#	lib/Frontend/Frontend.cpp
2017-09-14 16:46:37 -07:00
David Ungar
50e0db551d Ran my changes through git-clang-format.
# Conflicts:
#	lib/Frontend/Frontend.cpp
2017-09-14 16:44:28 -07:00
David Ungar
210cb3c9c1 Pull out supplyREPLFileWithImports.
# Conflicts:
#	lib/Frontend/Frontend.cpp
2017-09-14 16:40:17 -07:00
David Ungar
a489ddb170 Remove inline code that was moved to computeDelayedParsingCallback. 2017-09-14 16:37:44 -07:00
David Ungar
39771feaef Pulled out parsePartialModulesAndLibraryFiles. 2017-09-14 16:37:44 -07:00
David Ungar
f63cb71196 Pull out parseMainAndTypeCheckTopLevelFiles. 2017-09-14 16:37:44 -07:00
David Ungar
bff485856b Replace modImpKind w/ implicitModuleImportKind
# Conflicts:
#	lib/Frontend/Frontend.cpp
2017-09-14 16:37:43 -07:00
David Ungar
91bb47e068 Exploit constancy of FrontendOptions and InputFileKind
# Conflicts:
#	lib/Frontend/Frontend.cpp
2017-09-14 16:33:34 -07:00
David Ungar
c4abc01709 Replace "underlying" with "objCModuleUnderlyingMixedFramework". 2017-09-14 16:25:10 -07:00
David Ungar
2b5bfa65fe Pull out loadStdlibAndMaybeSwiftOnoneSupport. 2017-09-14 16:25:10 -07:00
David Ungar
ad8343059d Pull out shouldImplicityImportSwiftOnoneSupportModule. 2017-09-14 16:25:10 -07:00
David Ungar
d673df3473 Pull out importUnderlyingModule. 2017-09-14 16:25:10 -07:00
David Ungar
a27a5d9e28 Simplify interface to fillInModulesToImportFromImplicitImportModuleNames. 2017-09-14 16:25:10 -07:00
David Ungar
706c7a336a Pull out importBridgingHeader. 2017-09-14 16:25:10 -07:00
David Ungar
d77f1b2ede Pull out fillInModulesToImportFromImplicitImportModuleNames. 2017-09-14 16:25:09 -07:00
David Ungar
0dd19555d1 Pull out delayed parsing callback compulation. 2017-09-14 16:25:09 -07:00
David Ungar
85a33669a8 Pull out ensureMainFileComesFirst.
# Conflicts:
#	lib/Frontend/Frontend.cpp
2017-09-14 16:25:09 -07:00
David Ungar
3566ad73f4 Pull out createSILModuleIfNecessary so modImpKind can be clearly constant. 2017-09-14 16:24:01 -07:00
David Ungar
02c084ee83 Pull out parseALibraryFile.
# Conflicts:
#	lib/Frontend/Frontend.cpp
2017-09-14 16:24:01 -07:00
David Ungar
d40196d99a Pull out addAdditionalImports in preparation for next step. 2017-09-14 16:22:43 -07:00
David Ungar
0a95f3f725 Pull out computeTypeCheckingOptions. 2017-09-14 16:22:43 -07:00
David Ungar
36a490597f Pull out parseTheMainFile 2017-09-14 16:22:43 -07:00
David Ungar
28e4f0f333 pull out typeCheckTopLevelInputsExcludingMain 2017-09-14 16:22:43 -07:00
David Ungar
168a4bf0cc Pull out performWholeModuleTypeCheckingOnMainModule 2017-09-14 16:22:43 -07:00
David Ungar
3a7cc73043 pull out finishTypeCheckingMainModule 2017-09-14 16:22:43 -07:00
David Ungar
ae3d15cbd0 Remove redundant local variable shadowing instance variable
# Conflicts:
#	lib/Frontend/Frontend.cpp
2017-09-14 16:22:42 -07:00
Xi Ge
34e2aec662 Parser: use parser to generate a refined token stream to help syntax coloring. (#11809)
This patch allows Parser to generate a refined token stream to satisfy tooling's need. For syntax coloring, token stream from lexer is insufficient because (1) we have contextual keywords like get and set; (2) we may allow keywords to be used as argument labels and names; and (3) we need to split tokens like "==<". In this patch, these refinements are directly fulfilled through parsing without additional heuristics. The refined token vector is optionally saved in SourceFile instance.
2017-09-08 10:28:19 -07:00
Robert Widmann
75a83da03e Implement SE-0075: CanImport
This implementation required a compromise between parser
performance and AST structuring.  On the one hand, Parse
must be fast in order to keep things in the IDE zippy, on
the other we must hit the disk to properly resolve 'canImport'
conditions and inject members of the active clause into the AST.
Additionally, a Parse-only pass may not provide platform-specific
information to the compiler invocation and so may mistakenly
activate or de-activate branches in the if-configuration decl.

The compromise is to perform condition evaluation only when
continuing on to semantic analysis.  This keeps the parser quick
and avoids the unpacking that parse does for active conditions
while still retaining the ability to see through to an active
condition when we know we're moving on to semantic analysis anyways.
2017-08-28 18:35:06 -04:00
David Farler
645aaad551 [index/build] Upstream indexing while building changes
This patch upstreams previously AppleInternal changes for
indexing while building.
2017-06-29 16:20:06 -07:00
Mark Lacey
508d776c28 Adjust the expression type checker timeout to 10 minutes.
The old threshold was sometimes being reached on an ASAN bot.

Also fix a spot where I missed passing in the override value from the
command-line.

rdar://problem/32925008
2017-06-22 10:17:27 -07:00
Mark Lacey
e51e3e4bd4 Update determination of "too complex" expression to take time into account.
By default, end expression type checking after the elapsed process time
is more than 60 seconds for the current expression. This threshold can
be overridden by using -solver-expression-time-threshold=<seconds>.

Resolves rdar://problem/32859654
2017-06-21 16:26:34 -07:00
Roman Levenstein
2a10d8692b Clean-up the code that stored and passes the SILSerializeAll flag around.
- SILSerializeAll flag is now stored in the SILOptions and passed around as part of it
- Explicit SILSerializeAll/wholeModuleSerialized/makeModuleFragile API parameters are removed in many places
2017-06-16 17:50:33 -07:00
Mark Lacey
d26c859222 Add -warn-long-expression-type-checking=<limit> frontend option.
Generates a warning for any expression that takes longer than <limit>
milliseconds to type check. This compliments the existing
-warn-long-function-body=<limit> option.
2017-06-12 17:27:29 -07:00
Argyrios Kyrtzidis
e6f3af8edd [frontend] Fix use-after-free issue found via ASAN 2017-05-05 07:38:49 -07:00
Argyrios Kyrtzidis
b1fe90cc46 [frontend] Don't destroy the compiler instance object inside performCompile()
This permits continuing to use the diagnostic engine object from the instance.
2017-05-03 16:27:50 -07:00
Mark Lacey
e1d727d76d Fix unused variable warnings in release build. 2017-04-11 10:37:51 -07:00
Huon Wilson
31b92b1b46 Merge pull request #8473 from huonw/symbol-list-2
Remove dependency on IRGenModule of some linkage computations
2017-04-05 16:39:04 -07:00
Huon Wilson
65c6bdca90 [IRGen] Remove IGM argument, factor out conformance fragility logic. 2017-04-05 09:54:19 -07:00