Commit Graph

1419 Commits

Author SHA1 Message Date
practicalswift
a7b34c0b25 [gardening] Remove unused variable prevCase 2017-03-07 16:26:34 +01:00
Nathan Hawes
2684564590 [indexer] report defs/refs of parameters without a separate external name 2017-02-28 11:55:34 -08:00
practicalswift
99ceb78c7d Merge pull request #7723 from practicalswift/gardening-20170223
[gardening] Shell fixes. Consistent headers. a-vs-an typos. Python fixes. Unused variables and methods.
2017-02-27 14:05:05 +01:00
Erik Eckstein
7d7dc5aaac Demangler: Use a bump-pointer allocator for node allocation.
This makes the demangler about 10 times faster.
It also changes the lifetimes of nodes. Previously nodes were reference-counted.
Now the returned demangle  node-tree is owned by the Demangler class and it’s lifetime ends with the lifetime of the Demangler.

Therefore the old (and already deprecated) global functions demangleSymbolAsNode and demangleTypeAsNode are no longer available.

Another change is that the demangling for reflection now only supports the new mangling (which should be no problem because
we are generating only new mangled names for reflection).
2017-02-24 19:04:13 -08:00
Erik Eckstein
437d4da38d Demangling: Remove StringRef-versions of demangling functions from demangle_wrappers because they are now available in Demangle itself.
This is just refactoring. NFC.
2017-02-24 15:19:18 -08:00
practicalswift
3367d05ee2 [gardening] Remove unused variable OverUSROffs 2017-02-24 09:38:00 +01:00
Hugh Bellamy
f66bbfb7cf Merge pull request #7613 from hughbe/msvc-static-assertion-failure
Fix MSVC static assertion failure in SourceKit
2017-02-22 08:15:22 +07:00
Xi Ge
c62ec0c116 SourceKit: Introduce a new enum class to describe the kind of resolved sema token kind. NFC (#7657) 2017-02-20 23:18:54 -08:00
Hugh Bellamy
2cdee2f09d Fix MSVC static assertion failure in SourceKit 2017-02-21 10:33:25 +07:00
swift-ci
64882e0bbf Merge pull request #7611 from hughbe/resolve-symlinks 2017-02-19 20:37:18 -08:00
Hugh Bellamy
3464a9399d Port SwiftLangSupport::resolvePathSymlinks to Windows 2017-02-20 10:04:46 +07:00
swift-ci
2b8f47e3df Merge pull request #7610 from hughbe/sourcekit-api-msvc 2017-02-19 00:16:06 -08:00
Hugh Bellamy
dd0f185118 Fix some MSVC ambiguity errors in SourceKitAPI 2017-02-19 14:25:00 +07:00
Hugh Bellamy
2bc2341300 Fix SourceKit unreachable warnings 2017-02-19 14:20:52 +07:00
Hugh Bellamy
487955c306 Merge pull request #7607 from hughbe/atomic-msvc-ambi
Fix MSVC conversion from std::atomic<T *> to bool error
2017-02-19 13:14:21 +07:00
Hugh Bellamy
52501a2f9b Fix MSVC conversion from std::atomic<T *> to bool error
> swift\tools\SourceKit\include\SourceKit/Support/ThreadSafeRefCntPtr.h(139): error C2440: 'return': cannot convert from 'const std::atomic<T *>' to 'bool'
>          with
>          [
>              T=SourceKit::ImmutableTextUpdate
>          ] (compiling source file swift\tools\SourceKit\lib\Support\ImmutableTextBuffer.cpp)
>  swift\tools\SourceKit\include\SourceKit/Support/ThreadSafeRefCntPtr.h(139): note: Ambiguous user-defined-conversion (compiling source file swift\tools\SourceKit\lib\Support\ImmutableTextBuffer.cpp)
>  swift\tools\SourceKit\include\SourceKit/Support/ThreadSafeRefCntPtr.h(139): note: while compiling class template member function 'SourceKit::ThreadSafeRefCntPtr<SourceKit::ImmutableTextUpdate>::operator bool(void) const' (compiling source file swift\tools\SourceKit\lib\Support\ImmutableTextBuffer.cpp)
>  swift\tools\SourceKit\lib\Support\ImmutableTextBuffer.cpp(242): note: see reference to function template instantiation 'SourceKit::ThreadSafeRefCntPtr<SourceKit::ImmutableTextUpdate>::operator bool(void) const' being compiled
>  swift\tools\SourceKit\include\SourceKit/Support/ImmutableTextBuffer.h(66): note: see reference to class template instantiation 'SourceKit::ThreadSafeRefCntPtr<SourceKit::ImmutableTextUpdate>' being compiled (compiling source file swift\tools\SourceKit\lib\Support\ImmutableTextBuffer.cpp)
2017-02-19 09:55:09 +07:00
Hugh Bellamy
ddb97c113a Fix MSVC "ambiguous symbol errors" in SourceKit 2017-02-19 09:53:03 +07:00
Xi Ge
03a17e1f06 Cleanup: Move Swift to ObjC name translation API to libAST to allow larger audience body. NFC (#7586) 2017-02-17 22:09:25 -08:00
David Farler
677e03df85 [SourceKit] Vend the localization key found in documentation comments
If a documentation comment has a - LocalizationKey: field, strip it
out of the documentation body and report it in cursor/doc info with
the key "key.localization_key".

rdar://problem/30383329
2017-02-17 17:54:15 -08:00
David Farler
3645736ac0 Merge pull request #7393 from bitjammer/syntax-tree
Start the Syntax structured editing library
2017-02-17 15:26:00 -08:00
David Farler
7ee42994c8 Start the Syntax library and optional full token lexing
Add an option to the lexer to go back and get a list of "full"
tokens, which include their leading and trailing trivia, which
we can index into from SourceLocs in the current AST.

This starts the Syntax sublibrary, which will support structured
editing APIs. Some skeleton support and basic implementations are
in place for types and generics in the grammar. Yes, it's slightly
redundant with what we have right now. lib/AST conflates syntax
and semantics in the same place(s); this is a first step in changing
that to separate the two concepts for clarity and also to get closer
to incremental parsing and type-checking. The goal is to eventually
extract all of the syntactic information from lib/AST and change that
to be more of a semantic/symbolic model.

Stub out a Semantics manager. This ought to eventually be used as a hub
for encapsulating lazily computed semantic information for syntax nodes.
For the time being, it can serve as a temporary place for mapping from
Syntax nodes to semantically full lib/AST nodes.

This is still in a molten state - don't get too close, wear appropriate
proximity suits, etc.
2017-02-17 12:57:04 -08:00
Hugh Bellamy
fa3543d3c5 Fix some pylint errors for double whitespace after class/function 2017-02-17 15:37:19 +07:00
Xi Ge
b1c5c995a1 [IDE][Utils] Add an IDE stream utility. (#7546)
This provides a stream utility for writing to a underlying string buffer multiple string pieces and retrieve them later as StringRef when the underlying buffer is stable.
2017-02-16 17:29:42 -08:00
practicalswift
4e9bb3c9b2 Add a py3 compatible workaround for the removed long type 2017-02-15 21:43:52 +01:00
Argyrios Kyrtzidis
c309fb2620 Merge pull request #7477 from akyrtzi/fsystem-search-path-option2
Add '-Fsystem' framework search option to indicate path for frameworks that should be treated as 'system'
2017-02-15 12:04:36 -08:00
Argyrios Kyrtzidis
32e5112874 For the -Fsystem option, address feedback by Jordan. 2017-02-14 23:35:06 -08:00
Xi Ge
143c5a5d82 Address @jrose-apple's code review comments (#7474) 2017-02-14 18:41:21 -08:00
Argyrios Kyrtzidis
ca906d1e99 Add '-Fsystem' framework search option to indicate path for frameworks that should be treated as 'system'
This has the effect of propagating the search path to the clang importer as '-iframework'.
It doesn't affect whether a swift module is treated as system or not, this can be done as follow-up enhancement.
2017-02-14 16:13:25 -08:00
Xi Ge
055da1fbfb [SourceKit] Teach name translation request to translate Swift names to ObjC ones (by using PrintAsObjC). (#7449) 2017-02-14 14:25:52 -08:00
Hugh Bellamy
cb3bdcc2a3 Merge pull request #7408 from hughbe/llvm-fallthrough
Use relatively new LLVM_FALLLTHROUGH instead of our own SWIFT_FALLTHROUGH
2017-02-13 17:39:59 +07:00
Slava Pestov
559350ebe8 Merge pull request #7392 from alblue/sourcekit
Build SourceKit on Linux if dispatch is present
2017-02-12 17:34:22 -08:00
Hugh Bellamy
f001b7562b Use relatively new LLVM_FALLLTHROUGH instead of our own SWIFT_FALLTHROUGH 2017-02-12 10:47:03 +07:00
Xi Ge
b32424953e [SourceKit] Add a new request to translate from Objc names to Swift names and vice versa.
Extensive cross-language tooling support needs to bridge decl names between two different languages more freely. This SourceKit request is designed to translate Objc names to Swift names and vice versa. Working similarly to cursor-info requisition, the name translation request requires a Swift reference to a Swift/Clang decl, and the preferred name to translate from, and language kind that the given name belongs to. If the translation succeeds, SourceKit service responds with the corresponding name than belongs to the other kind of language.

Newly introduced keys:

“key.namekind": “source.lang.name.kind.objc” | "source.lang.name.kind.swift"
“key.basename”: “name"
“key.argnames”: [“name"]
“key.selectorpieces”: [“name[:]"]

This commit only implements translation from Objc to Swift.
2017-02-10 17:50:12 -08:00
Alex Blewitt
1673b5e8fd Build SourceKit on Linux if dispatch is present
SourceKit can be built on Linux if dispatch is available
so enable this so it happens by default.

Issue: SR-1676
2017-02-10 22:03:13 +00:00
Chris B
19ac633de9 Merge pull request #7344 from llvm-beanz/import-cmark-targets
Clean up handling of CMark library dependency.
2017-02-09 13:45:36 -08:00
Doug Coleman
cb973ae67a sourcekitd/CMakeLists.txt: Add a flag for building sourcekitdInProc as a
static library.
2017-02-08 17:17:55 -08:00
Chris Bieneman
44b6f32f0e Clean up handling of CMark library dependency.
This change depends on:

https://github.com/apple/swift-cmark/pull/4
2017-02-08 14:32:50 -08:00
Graydon Hoare
7137bab0c7 [Bridging PCH] Teach SourceKit to ignore the bridging-pch driver options. 2017-02-02 17:07:10 -08:00
Xi Ge
6b699d8855 SourceEntityWalker: keep track of type reference in extension declarations' openings. (#7192)
This is necessary when we want to differentiate between type reference
on extension declaration's start, e.g "extension A {}", and other
references of "A". NFC on existing functionality.
2017-02-01 17:09:01 -08:00
Slava Pestov
b3cabb0745 Use llvm casts in various places instead of looking at {Expr,Decl,TypeBase}::getKind()
Also add some FIXMEs for some code in debug info emission that
looks incorrect.
2017-01-30 00:08:53 -08:00
Erik Eckstein
4d00ac1bba New mangling: add a -new-mangling-for-tests option.
This option enables the new mangling for everything except the Swift stdlib module.
Used to switch test files explicitly to the new mangling.
2017-01-24 15:27:45 -08:00
Slava Pestov
8289a19f53 Merge pull request #6858 from alblue/SR-1676
Enable sourcekitd to be built by default on Linux
2017-01-20 21:11:06 -08:00
Bob Wilson
24a61b5b5d Merge branch 'master-next'
This merge contains the changes to accompany the switch to the new stable
branches of llvm, clang, and compiler-rt that are based on swift-4.0-branch.
2017-01-18 09:22:52 -08:00
Argyrios Kyrtzidis
da1328f04b [sourcekit] Fix assertion hit when doing cursor-info on a subscript parameter declaration.
Fixes rdar:/30060622
2017-01-17 14:56:36 -08:00
Alex Blewitt
3e9f66c6ca Enable sourcekitd to be built by default on Linux
The Linux build has a dependency on the libdispatch library,
which is needed by the various native libraries for sourcekitd.

On macOS, the dependency for libdispatch is satisfied directly through
the base OS, but on Linux no such dependency exists.

Modify this so that if the SourceKit library is built, and the
libdispatch library is already present, then we shell out to make
the libdispatch binary project when the SourceKit is built.

Issue: SR-1676
2017-01-17 19:21:52 +00:00
Alex Blewitt
25fc295e4a Revert "Merge pull request #6807 from alblue/SR-1676"
This reverts commit c85cbe5c78, reversing
changes made to 5d293ab9d2.
2017-01-17 09:47:07 +00:00
Alex Blewitt
f7836ae0c8 Enable sourcekitd to be built by default on Linux
The Linux build has a dependency on the libdispatch library,
which is needed by the various native libraries for sourcekitd.

On macOS, the dependency for libdispatch is satisfied directly through
the base OS, but on Linux no such dependency exists.

Modify this so that if the SourceKit library is built, and the
libdispatch library is already present, then we shell out to make
the libdispatch binary project when the SourceKit is built.

Issue: SR-1676
2017-01-14 10:38:45 +00:00
Bob Wilson
c765d5e3a5 Merge remote-tracking branch 'origin/master' into master-next 2017-01-12 15:58:19 -08:00
Argyrios Kyrtzidis
7076ebbf72 [index] Switch to using the general accessor getter/setter symbol kinds. 2017-01-11 17:09:17 -08:00
Slava Pestov
d2e80da8db Merge pull request #4733 from AquaGeek/sourcekit-docs
[SourceKit] Document source.request.mangle_simple_class
2017-01-11 00:01:57 -08:00