Commit Graph

344 Commits

Author SHA1 Message Date
swift-ci
dd694cb1ca Merge remote-tracking branch 'origin/master' into master-next 2017-12-11 20:49:53 -08:00
Bob Wilson
390058972a [master-next] Use PRIVATE in target_link_libraries for executables
This is needed to work with LLVM r319840.
2017-12-06 21:55:22 -08:00
David Ungar
704d7258d1 Rename hasUniqueInput to hasSingleInput. 2017-12-06 15:25:16 -08:00
David Ungar
28b206008f FrontendInputs data structure redo.
- Outlaw duplicate input files, fix driver, fix tests, and add test.
- Reflect that no buffer is present without a (possibly pseudo) named file.
- Reflect fact that every input has a (possible pseudo) name.
- Break up CompilerInstance::setup.

Don't bail on dups.
2017-12-05 17:28:03 -08:00
David Ungar
04c16cdebd Incorperate advice from review.
Change “have” routines to “has”.
Use more consistent casing.
Remove spurious “DelayedFunctionParsing” option.
Move debugFail routines to top lexical level.
Rename and reorder declaration of functions in FrontendArgsToOptionsConverter.
Move, reword, and doxygenate comments for some of those functions.
Fix casing on some more setUp* functions.
Return NoneAction instead of existing RequestedAction in FrontendArgsToOptionsConverter::determineRequestedAction.
Remove test names and put in FIXME’s.
Remove “Jordan” from comments & reword.
Reorder if-then arms of FrontendArgsToOptionsConverter::computeOutputFilenames for readability.
Test for empty string instead of equality with “”.
Use hasUnusedModuleDocOutputPath.
Remove optionality from return type of getOutputFilenamesFromCommandLineOrFilelist.
Rename isPrimaryInputAFileAt to isThereAPrimaryInputWithAFilenameAt.
Added a FIXME in doesActionProduceOutput to reflect that some actions actually do not produce output.
2017-11-30 17:28:15 -08:00
Arnold Schwaighofer
1a0443040e Revert "Merge pull request #12952 from davidungar/move-in-to-next"
This reverts commit 911140c7e1, reversing
changes made to 5590a2ff91.

This broke the incremental bot.

rdar://35746584
2017-11-29 08:09:42 -08:00
David Ungar
b4681b154d Incorperate advice from review.
Change “have” routines to “has”.
Use more consistent casing.
Remove spurious “DelayedFunctionParsing” option.
Move debugFail routines to top lexical level.
Rename and reorder declaration of functions in FrontendArgsToOptionsConverter.
Move, reword, and doxygenate comments for some of those functions.
Fix casing on some more setUp* functions.
Return NoneAction instead of existing RequestedAction in FrontendArgsToOptionsConverter::determineRequestedAction.
Remove test names and put in FIXME’s.
Remove “Jordan” from comments & reword.
Reorder if-then arms of FrontendArgsToOptionsConverter::computeOutputFilenames for readability.
Test for empty string instead of equality with “”.
Use hasUnusedModuleDocOutputPath.
Remove optionality from return type of getOutputFilenamesFromCommandLineOrFilelist.
Rename isPrimaryInputAFileAt to isThereAPrimaryInputWithAFilenameAt.
Added a FIXME in doesActionProduceOutput to reflect that some actions actually do not produce output.
2017-11-28 09:21:35 -08:00
David Ungar
83ee8cb7f0 Merge pull request #12920 from davidungar/Move-input-conversion
Move input conversion
2017-11-27 17:13:48 -08:00
David Ungar
26537ea26c Address Jordan’s comments:
- Also be consistent about has vs have for Input predicates

Fix bug.
2017-11-18 14:00:32 -08:00
swift-ci
75dc7c1b73 Merge pull request #13011 from modocache/driver-typo 2017-11-18 14:00:29 -08:00
Brian Gesiak
70ad32c598 [Driver] Fix typo: half sentence and period 2017-11-18 12:25:34 -05:00
Xi Ge
6af5d3c0bf libSyntax: rename KeepTokensInSourceFile to KeepSyntaxInfoInSourceFile. 2017-11-03 18:39:01 -07:00
David Ungar
47ee930a50 git-clang-format'ed 2017-10-08 23:56:03 -07:00
David Ungar
c1821755de NFC: First step (refactoring) towards speeding up compilation by having multiple primary files: Creates new class, FrontendInputs, to encapsulate InputFilenames, InputBuffers, and PrimaryInput, which were formerly in FrontendOptions. Add new instance variable, Inputs, to FrontendOptions in order to hold FrontendInputs.
Encapsulate uses of the variables in FrontendInputs with intention-describing functions. Move some code that sets these variables into FrontendInputs and FrontendOptions classes.

Create new FrontendInputs class to encapsulate InputFilenames, InputBuffers and PrimaryInput, which were formerly in Frontend.

Includes one change in SwiftEditor.cpp to resolve a merge conflict.
2017-10-08 10:20:37 -07:00
Brian Gesiak
0f6ba7b681 [swift-format] Set exec path in initializer (NFC) (#11973)
Rather than define `SwiftFormatInvocation::setMainExecutablePath()` and use it
in the one spot where a `SwiftFormatInvocation` is initialized, have
`SwiftFormatInvocation` take an executable path in its initializer. No
functional change, but slightly fewer lines of code.
2017-09-17 18:49:29 -04: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
swift-ci
e98182387b Merge remote-tracking branch 'origin/master' into master-next 2017-07-11 12:23:35 -07:00
Ankit Aggarwal
d84e4b4de1 [Driver] Remove built-in run subcommand
This is as per discussion in https://bugs.swift.org/browse/SR-5332
2017-07-10 10:35:00 +05:30
Greg Parker
7b009eccde Merge remote-tracking branch 'origin/master' into master-next 2017-06-28 15:25:17 -07:00
Saleem Abdulrasool
3c4c910e7b build: create and use a wrapper for add_llvm_tool_symlink
Introduce a new function `add_swift_tool_symlink`.  Use this instead of the
`add_llvm_tool_symlink` and `install_in_swift_component`.  This mimics the
behaviour in clang as well as the general pattern of renaming the functions from
the LLVM build infrastructure.
2017-06-16 15:59:12 -07:00
swift-ci
4ebe4afe2a Merge remote-tracking branch 'origin/master' into master-next 2017-05-09 13:28:49 -07:00
Saleem Abdulrasool
60220ad84b swift-format: allow reading from stdin as specified
We would previously fail to read from stdin as we would diagnose an
error if no input files were provided.  This allows us to read from
stdin once more.
2017-05-06 11:12:09 -07:00
Saleem Abdulrasool
cd751c4350 swift-format: use named return codes (NFC)
Use `EXIT_SUCCESS` and `EXIT_FAILURE` rather than the raw values.  NFC.
2017-05-06 11:12:09 -07:00
swift-ci
fe1b506392 Merge remote-tracking branch 'origin/master' into master-next 2017-04-14 17:28:31 -07:00
Maxwell Swadling
93d485e4f7 Changed handleDiagnostic to take a format string and format args instead of the formatted string
This allows diagnostic consumers to modify the way formatting of diagnostics is performed.
rdar://problem/31305854
2017-04-14 11:28:04 -07:00
Bob Wilson
07019d964d Update Swift master-next after LLVM API change in r300135. 2017-04-13 12:30:04 -07:00
David Farler
65668c9d82 Cache Code Completion results from PCH files
- Add CompilerInvocation::getPCHHash
  This will be used when creating a unique filename for a persistent
  precompiled bridging header.

- Automatically generate and use a precompiled briding header
  When we're given both -import-objc-header and -pch-output-dir
  arguments, we will try to:
  - Validate what we think the PCH filename should be for the bridging
    header, based on the Swift PCH hash and the clang module hash.
    - If we're successful, we'll just use it.
    - If it's out of date or something else is wrong, we'll try to
      emit it.
  - This gives us a single filename which we can `stat` to check for the
    validity of our code completion cache, which is keyed off of module
    name, module filename, and module file age.

- Cache code completion results from imported modules
  If we just have a single .PCH file imported, we can use that file as
  part of the key used to cache declarations in a module.  Because
  multiple files can contribute to the __ObjC module, we've always given
  it the phony filename "<imports>", which never exists, so `stat`-ing it
  always fails and we never cache declarations in it.

  This is extremely problematic for projects with huge bridging headers.
  In the case where we have a single PCH import, this can bring warm code
  completion times down to about 500ms from over 2-3s, so it can provide a
  nice performance win for IDEs.

- Add a new test that performs two code-completion requests with a bridging header.
- Add some -pch-output-dir flags to existing SourceKit tests that import a bridging
  header.

rdar://problem/31198982
2017-04-04 20:44:33 -07:00
Bob Wilson
cf3a0458f2 Merge remote-tracking branch 'origin/master' into master-next 2017-01-10 09:05:23 -08:00
Slava Pestov
dfebf20670 Merge pull request #6387 from hughbe/symlink-win32
[CMake] fix symlink creation on Windows
2017-01-09 12:27:21 -08:00
Bob Wilson
37e7d1c627 Merge remote-tracking branch 'origin/master' into master-next 2017-01-08 17:07:46 -08:00
Brian Gesiak
663b92ece9 [AST] Completely replace Module with ModuleDecl
The typedef `swift::Module` was a temporary solution that allowed
`swift::Module` to be renamed to `swift::ModuleDecl` without requiring
every single callsite to be modified.

Modify all the callsites, and get rid of the typedef.
2017-01-08 00:36:08 -05:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Bob Wilson
4ca0676a34 Merge remote-tracking branch 'origin/master' into master-next 2017-01-05 17:11:16 -08:00
Maxwell Swadling
35b2c68bd5 Revert "Revert "Introduce and use SWIFT_HAVE_LIBEDIT""
This reverts commit ef49338283.
2017-01-03 17:04:24 -08:00
Bob Wilson
78b28243ff Merge remote-tracking branch 'origin/master' into master-next 2017-01-03 14:22:59 -08:00
Hugh Bellamy
888afe139c Fix creating symlinks on Windows 2016-12-27 14:55:05 +00:00
Hugh Bellamy
76a6f87890 Introduce and use SWIFT_HAVE_LIBEDIT 2016-12-22 17:56:08 +00:00
Jordan Rose
fdd02f61d3 [CMake] Stop linking CoreFoundation into swiftc and libobjc into everything.
We link the stdlib against Foundation and that's quite sufficient for the REPL
and script mode to work.
2016-12-22 08:50:13 -08:00
Bob Wilson
13da3fa8b1 Merge remote-tracking branch 'origin/master' into master-next 2016-12-04 18:16:09 -08:00
Saleem Abdulrasool
6434a90032 Revert "build: use add_llvm_tool_symlink" 2016-12-03 15:14:33 -08:00
Saleem Abdulrasool
4a90e194c7 build: use add_llvm_tool_symlink
Rather than invoke the create_symlink command manually which wont work on
Windows, use the add_llvm_tool_symlink.
2016-12-03 12:21:24 -08:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Saleem Abdulrasool
46d684f35f remove usage of BitstreamReader
LLVM SVN r286207 removed the BitstreamReader interface.  Remove the usage of the
type, updating the cursor constructor accordingly.
2016-11-15 17:39:37 -08:00
Bob Wilson
f10ae47b9f Merge remote-tracking branch 'origin/master' into master-next 2016-11-15 17:32:28 -08:00
Saleem Abdulrasool
c7317ff9d0 driver: adjust for SVN r286561
LLVM SVN r286561 made the default constructor for llvm::Error protected,
requiring value initialization to `llvm::Error::success()`.  Update the code
accordingly.
2016-11-15 09:49:30 -08:00
Daniel Duan
d0de084a79 [swift-format] add option to indent switch block
add a boolean option to indent switch's block:

```
// with -indent-switch-case
switch xyz {
  case .x:
    doSomething()
}
```

```
// without -indent-switch-case
switch xyz {
case .x:
  doSomething()
}
```
2016-11-03 19:48:41 -07:00
Daniel Duan
f5ed77a032 Merge pull request #5093 from danielmartin/swift-format-SR-2619
[swift-format] Remove dependency on clang::tooling::Replacement
2016-10-29 22:44:23 -07:00
Bob Wilson
9cc68d6c9f Update for clang r283671: remove use of clEnumValEnd. 2016-10-15 11:02:20 -07:00
Daniel Martín
81f87e5e9d Remove dependency on clang::tooling::Replacement
Considering that formatting only affects a single compilation unit, and
that code formatting does not support line ranges yet, remove dependency
on clang::tooling::Replacement.

This fixes SR-2619.
2016-10-02 21:16:31 +02:00
Doug Gregor
580a2812a3 [Clang importer] Enable API notes alongside header/frameworks.
Enable newly-introduced Clang functionality to load API notes stored
alongside the headers for a module or, for a framework, in an APINotes
subdirectory within the framework. Fixes rdar://problem/28455644.
2016-09-28 00:13:16 -07:00