Commit Graph

3682 Commits

Author SHA1 Message Date
David Ungar
663760e3b7 ASTOOScope ontology 2019-05-28 10:48:22 -07:00
Xi Ge
92719d6f30 swift-api-digester: mark if a type declaration is pulled from an external module
To incorporate extensions to types from other modules, the tool sometimes needs
to pull type declaration from external modules even though these modules
are not under checking. We need a flag to explicitly mark such case.
2019-05-24 16:02:40 -07:00
Xi Ge
6e0d771747 Merge pull request #25039 from nkcsgexi/intro-json-file
api-digester: keep track of the introduced platforms and language versions for all APIs
2019-05-24 12:09:07 -07:00
Argyrios Kyrtzidis
b1b6ce6916 Merge pull request #25033 from akyrtzi/sourcekitd-expose-indent-switch-option
[sourcekitd] Expose the indentation option for extra indentation of switch case
2019-05-23 20:48:00 -07:00
Xi Ge
7b445c3c98 api-digester: keep track of the introduced platforms and language versions for all APIs
These fields will be used to diagnose the missing of available
attributes for newly added APIs.

rdar://51089418
2019-05-23 17:23:30 -07:00
Argyrios Kyrtzidis
1dcb1e083a [sourcekitd] Expose the indentation option for extra indentation of switch case
rdar://51079623
2019-05-23 16:21:30 -07:00
Xi Ge
6a204b7dda Merge pull request #25002 from nkcsgexi/digester-missing
swift-api-digester: avoid adding MissingMemberDecl to the json file
2019-05-22 19:28:40 -07:00
Xi Ge
f5853ba44f swift-api-digester: avoid adding MissingMemberDecl to the json file
We explicitly ignore these ABI placeholders to fix an unreachable hit.
2019-05-22 18:09:42 -07:00
Joe Groff
7d54810b92 Revert "[SourceKit] Fail requests when an error occurs" 2019-05-22 15:18:28 -07:00
Argyrios Kyrtzidis
729a9558e8 Merge pull request #24124 from DavidGoldman/master
[SourceKit] Fail requests when an error occurs
2019-05-22 10:49:42 -07:00
David Goldman
1c819820fa Comment and sourcekitd-test fixes 2019-05-21 10:40:22 -04:00
Xi Ge
e8588672da Merge pull request #24939 from nkcsgexi/doc-support-issue
Sourcekit/DocSupport: fix an assertion when generating documentation for extensions with attributes
2019-05-20 18:59:53 -07:00
Xi Ge
1ca8e83aa3 Sourcekit/DocSupport: fix an assertion when generating documentation for extensions with attributes
When sanitizing the documentation comments for synthesized extensions,
we expect some text like "<declaration>extension". This isn't the case
when use-facing attributes are present.

rdar://50913510
2019-05-20 17:43:29 -07:00
Xi Ge
bfed404c7c api-digester: rename argument -compare-sdk to -generate-migration-script. SR-10489 2019-05-17 12:54:13 -07:00
Xi Ge
7a99da3a06 Merge pull request #24817 from nkcsgexi/digester-avoid-update
api-digester: avoid looking up node update table to collect renamed declarations. NFC
2019-05-15 20:43:23 -07:00
Xi Ge
99caadf794 api-digester: avoid looking up node update table to collect renamed declarations
We could simply get the new name from the node annotation of the decl before renaming.
2019-05-15 17:20:48 -07:00
Jordan Rose
6caedcde57 Merge pull request #24788 from apple/command-p
Don't print extensions to conform to protocols that aren't printed

rdar://problem/50748072
2019-05-15 17:20:11 -07:00
Xi Ge
60ee9527bb Merge pull request #24776 from nkcsgexi/digester-fix
Several swift-api-digester fixes
2019-05-15 10:55:14 -07:00
Jordan Rose
c622f6b8dd Simplify swift::getInheritedForPrinting to take a PrintOptions
This lets us make some more assumptions in the next commit, but I
think it's also just a nice cleanup to /not/ allow random predicates
here.

There were three callers of this API:

- PrintAST, which was using PrintOptions::shouldPrint but /also/
  incorrectly notifying listeners that a declaration would be skipped.

- (IDE) Interface generation, which uses PrintOptions::shouldPrint to
  count how many "inherits" there will be.

- SwiftDocSupport's reportRelated, which does no filtering at all.
  Creating a PrintOptions here is a little more expensive, but still.

No intended functionality change.
2019-05-14 16:16:28 -07:00
Xi Ge
ae16a74af9 api-digester: diagnose adding conformances to existing protocols. rdar://48131686 2019-05-14 15:40:04 -07:00
Xi Ge
f7881eed66 cmake: specify only one component toolchain-tools for swift-api-digester 2019-05-14 15:04:11 -07:00
Xi Ge
23cd5f037d api-digester: use target triple to check platform info 2019-05-14 14:12:14 -07:00
Xi Ge
b0005a5bdc api-digester: disable objc interop when building on linux. SR-10539 2019-05-14 11:13:58 -07:00
Xi Ge
da442f4adc api-digester: remove node comparison cache because it may consume too much memory 2019-05-14 11:07:21 -07:00
Ross Bayer
d332d21056 [Build System: CMake] Set the install_name_dir to @rpath for the SwiftLang module in SourceKit. 2019-05-13 17:15:08 -07:00
Xi Ge
bf93fac186 Merge pull request #24586 from dmcyk/ProtocolUSR
[api-digester] Serialize protocol USRs in conformances
2019-05-13 15:35:48 -07:00
dmcyk
d2603af8b1 [api-digester] Remove whitespace changes 2019-05-13 20:43:02 +02:00
Gwen Mittertreiner
77c26874d1 [Windows] Fix resolvePathSymlinks
The llvm::ArrayRef constructor should be passed the actual length of the
resulting string, not MAX_PATH, else the StringRef that results has an
incorrect length of MAX_PATH.
2019-05-08 13:15:10 -07:00
dmcyk
1142b6037c [api-digester] Include USRs in conformances
SDK conformance nodes include only protocol
`name` and `printedName`, both are demangled.
USR field of the protocol type is added, to be able
to uniquely identify conformances.
2019-05-07 22:09:28 +02:00
Ben Langmuir
a861e760e7 Merge pull request #24520 from benlangmuir/cc-crash-keypath
[code-completion] Avoid invalid member substitution for keypath dynamic lookup
2019-05-06 15:28:50 -07:00
Ben Langmuir
34da079aa6 Pass DynamicLookupInfo through VisibleDeclConsumers NFC
This commit adds a new type DynamicLookupInfo that provides information
about how a dynamic member lookup found a particular Decl. This is
needed to correctly handle KeyPath dynamic member lookups, but for now
just plumb it through everywhere.
2019-05-06 10:02:39 -07:00
Saleem Abdulrasool
218b37e1bb build: rename LLVM_COMPONENT_DEPENDS
This is not a target dependency but a target link.  Name the parameter
to be less misleading.  This also makes the name identical to the LLVM
parameter.
2019-05-04 19:58:28 -07:00
David Goldman
6d59776e0d Fix bad merge 2019-05-03 15:44:14 -04:00
David Goldman
9a9854b291 Merge 2019-05-03 15:39:23 -04:00
David Goldman
00d771ca6b RequestResult class and Pass*InfoForDecl fixes 2019-05-03 15:17:40 -04:00
David Goldman
a3a4d2d22b Add InternalDiagnostic to CursorInfoData and NameTranslatingInfo 2019-05-03 11:01:22 -04:00
David Goldman
10ecea6269 [SourceKit] Fail requests when an error occurs
Previously, requests would fail silently by returning an empty struct
in the response.

With this change, responses will properly report fail with the internal
error.
2019-05-03 11:01:21 -04:00
Saleem Abdulrasool
2e7c328077 Merge pull request #24168 from xiaobai/sink_component_arg
[CMake] Modify swift_install_in_component to support cmake install components
2019-04-30 21:06:32 -07:00
Ben Langmuir
6377199e2f [placeholder-expansion] Expand trailing closure in statements correctly
In addition to brace statements (previously handled), several other
statements allow a trailing closure (return, yield, throw). Also fix the
handling of statements nested within expressions for closures - both
single-expression bodies and brace statements.

This also fixes a particular regression caused by single-expression
function bodies where we would fail to expand to a trailing closure when
a function body only contained a single expression.

rdar://50227500
2019-04-26 11:58:52 -07:00
Ben Langmuir
53346fd38e Merge pull request #24285 from benlangmuir/digest-attr
[api-digester] Force lazy attribute calculations as workaround
2019-04-26 08:43:21 -07:00
Ben Langmuir
27b12bfe89 Merge pull request #23978 from AnthonyLatsis/expand-closure-check-braces
SourceKit: Account for existing braces when expanding closure placeholders
2019-04-25 15:00:40 -07:00
Ben Langmuir
81ce653bc3 Merge pull request #23587 from benlangmuir/cc-omit-return
[code-completion] Add type context for single-expression function bodies
2019-04-25 13:49:45 -07:00
Ben Langmuir
8fbd71c25e [api-digester] Force lazy attribute calculations as workaround
We were relying on attributes being propagated by the type-checker, for
example from a property to its accessors, but the goal is for these to
be caculated lazily by the request evaluator, so we should be checking
the AST predicates instead.  As a workaround, force calculating them to
cause the attributes to be added for now to fix a CI failure.

Patch by @slavapestov

rdar://50184238
2019-04-25 13:34:11 -07:00
Jordan Rose
f4487881e4 Add PrettyStackTraceSwiftVersion, and use it in the swiftc executable (#24235)
As pointed out on a recent JIRA, crash traces don't mention what
version of Swift you were running. Usually that can be gleaned from
the path, but not always.
2019-04-24 15:53:56 -07:00
Gwen Mittertreiner
cac35ca06b Merge pull request #24171 from gmittert/SourceKitTests
Fix SourceKit/CursorInfo Tests on Windows
2019-04-23 10:30:10 -07:00
Gwen Mittertreiner
7da91d5aeb Fix SourceKit/CursorInfo Tests on Windows 2019-04-22 15:55:55 -07:00
adrian-prantl
ecebf70745 Merge pull request #24173 from adrian-prantl/memorybufferloader
Factor out the pre-registered MemoryBuffer functionality
2019-04-22 11:32:06 -07:00
Rintaro Ishizaki
73d3fd6631 Merge pull request #24177 from rintaro/sourcekit-opaque-result-types
[SourceKit] SourceKit support for opaque result types
2019-04-22 09:58:47 -07:00
Harlan Haskins
0785fd797b [swift-api-digester] Put command-line flags in their own category (#24178)
Previously, swift-api-digester -help would print a bunch of unrelated
LLVM and SIL command-line flags. Putting these in their own category
limits the help output to the specific set of flags swift-api-digester
recognizes.
2019-04-22 09:58:01 -07:00
Adrian Prantl
b244b0928e Factor out the pre-registered MemoryBuffer functionality
form SerializedModuleLoader into its own ModuleLoader class. (NFC-ish)

This gives better control over the order in which the various module
load mechanisms are applied.
2019-04-22 09:17:08 -07:00