Commit Graph

865 Commits

Author SHA1 Message Date
David Ungar
663760e3b7 ASTOOScope ontology 2019-05-28 10:48:22 -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
Michael Munday
d3262ec10d [IRGen] Remove SetBitEnumerator from ClusteredBitVector
The change replaces 'set bit enumeration' with arithmetic
and bitwise operations. For example, the formula
'(((x & -x) + x) & x) ^ x' can be used to find the rightmost
contiguous bit mask. This is essentially the operation that
SetBitEnumerator.findNext() performed.

Removing this functionality reduces the complexity of the
ClusteredBitVector (a.k.a. SpareBitVector) implementation and,
more importantly, API which will make it easier to modify
the implementation of spare bit masks going forward. My end
goal being to make spare bit operations work more reliably on
big endian systems.

Side note:

This change modifies the emit gather/scatter functions so that
they work with an APInt, rather than a SpareBitVector, which
makes these functions a bit more generic. These functions emit
instructions that are essentially equivalent to the parallel bit
extract/deposit (PEXT and PDEP) instructions in BMI2 on x86_64
(although we don't emit those directly currently). They also map
well to bitwise manipulation instructions on other platforms (e.g.
RISBG on IBM Z). So we might find uses for them outside spare bit
manipulation in the future.
2019-05-17 11:55:06 +01:00
David Goldman
00d771ca6b RequestResult class and Pass*InfoForDecl fixes 2019-05-03 15:17:40 -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
Argyrios Kyrtzidis
5a6a110f16 Merge pull request #24227 from akyrtzi/gyb-syntax-def-element-name
[utils/gyb_syntax_support] Add `collection_element_name` for when specifying a `Child`
2019-04-24 00:19:49 -07:00
Argyrios Kyrtzidis
3612cd3d72 [utils/gyb_syntax_support] Add collection_element_name for when specifying a Child
This is useful to provide `add<ELEMENT_NAME>` APIs for SwiftSyntax that are better named
and without having name conflicts.
2019-04-23 18:14:39 -07:00
Slava Pestov
3f5a06bc3e AST: Always diagnose request evaluator cycles 2019-04-22 22:22:23 -04:00
Xi Ge
ddd643fe89 syntax: perform rename to avoid name collision in syntax builder. NFC 2019-04-20 16:04:41 -07:00
Xi Ge
a9ba1ced6c Merge pull request #24176 from nkcsgexi/syntax-disambiguity
Syntax: use child name instead of type name for gyb-generated functions. NFC
2019-04-19 19:27:30 -07:00
Xi Ge
1015a6024d Syntax: use child name instead of type name for gyb-generated functions
ParsedSyntaxBuilder has a convenient function to add member to a syntax-collection
child. The function name uses the type name of the collection's members,
which can lead to name collision. This patch renames it.
2019-04-19 18:16:13 -07:00
Joe Groff
05dfec0cda Push the conformance accessor hack down into getTypeByMangledName. 2019-04-17 14:44:40 -07:00
Jordan Rose
f6c7973911 Teach -verify-apply-fixes to handle overlapping fix-its (#23970)
...by coalescing duplicates and dropping conflicts. Both cases can
happen with "expected-error 2 {{...}}": we might get multiple fix-its
providing the same new message, or one message might have diverged
into two, giving us incompatible changes.
2019-04-12 13:19:54 -07:00
Mike Ash
855dd8d5fb [Tests] Use a plain array of std::atomic rather than a vector of atomic.
The restrictions on std::atomic make a it fragile to have a vector of them, and this failed to compile on Linux in CI.

While I'm in there, clean up a couple of tests that repeated a raw `10` for the thread count.

rdar://problem/49709062
2019-04-09 10:52:53 -04:00
Mishal Shah
c4626baf88 Un-set CMAKE_C_COMPILER_LAUNCHER and CMAKE_CXX_COMPILER_LAUNCHER in s… (#23806)
[CMake] Add check for distcc before setting CMAKE_C_COMPILER_LAUNCHER and CMAKE_CXX_COMPILER_LAUNCHER
2019-04-08 12:53:35 -07:00
swift-ci
98200dbc3c Merge pull request #23816 from mikeash/improve-mutex-tests 2019-04-08 12:09:20 -07:00
David Ungar
cf5d81c889 Merge pull request #23735 from davidungar/tracking-primary
[Batch mode] Cope with bugs that cause error  suppression.
2019-04-05 17:45:20 -07:00
Mike Ash
6172f72af9 [Tests] Make Mutex.cpp tests more reliable.
Many of these tests would fail if one of the test threads didn't begin execution within 100 milliseconds. They would hit while (!done) the very first time and never execute the loop body. That does happen from time to time, and the result would be a spurious failure. Change the loops to do {} while(!done) to ensure they always execute at least one iteration.

Many tests also had the test threads concurrently write results to a std::vector, which appeared to be causing some failures in my local testing when I had extra sleeps inserted to simulate pathological scheduling. Change the results vectors to be vectors of std::atomic to ensure that this concurrent writing is safe.

These changes shouldn't affect its ability to test the functionality it intends to test.

rdar://problem/49386389
2019-04-05 16:40:08 -04:00
David Ungar
44daa88ebd Format 2019-04-03 12:53:31 -07:00
David Ungar
9cc3a4a9d8 Rename defaultDiagnosticLoc to bufferIndirectlyCausingDiagnostic. 2019-04-03 12:52:49 -07:00
David Ungar
c139c5909a Pass defaultDiagnosticLoc to handleDiagnostic, not currentPrimaryInput. 2019-04-02 22:27:55 -07:00
David Ungar
7a0e0ffc8a Store current primary in diagnostic engine, pass it down via handleDiagnostic. Unformmated. 2019-04-02 00:43:28 -07:00
Saleem Abdulrasool
61c5064c5f build: use clang/clang-cl to build SwiftSyntaxParser
This allows us to build SwiftSyntaxParser even if we are building with a
different compiler (i.e. cl).
2019-03-27 15:06:00 -07:00
Saleem Abdulrasool
d006c53a4a Merge pull request #23556 from mikeash/add-missing-remotemirror-interop-test-file
[RemoteMirror] Add missing test.swift file for interop tests.
2019-03-25 22:43:57 -07:00
Mike Ash
b51b60b227 [RemoteMirror] Add missing test.swift file for interop tests. 2019-03-25 20:51:17 -04:00
Harlan Haskins
9ef4b5f358 [ParseableInterface] Add test for writing modules to a buffer 2019-03-22 17:29:11 -07:00
Duncan P. N. Exon Smith
43e771e55b Reapply ClangImporter changes to leverage Clang's module cache
This reapplies four commits for the ClangImporter.  They broke the build
on master because the associated commits on swift-clang's
swift-5.1-branch never made it to stable due to automerger woes.  This
time I'll push everything through manually.

These are the commits being reapplied:

- a42bc62397 "ClangImporter: Share a module cache between CompilerInstances"
- 9eed34235b "ClangImporter: Adjust to r355777, PCMCache => ModuleCache"
- da8a1c57e8 "ClangImporter: Use the new CacheGeneratedPCH in Clang"
- 2134b17a20 "ClangImporter: Test that PCHs are actually cached in memory"

rdar://problem/48545366
2019-03-20 09:59:58 -07:00
Davide Italiano
ff10e7f8c6 Revert "ClangImporter: Test that PCHs are actually cached in memory"
This reverts commit 2134b17a20.
2019-03-18 11:30:51 -07:00
Duncan P. N. Exon Smith
2134b17a20 ClangImporter: Test that PCHs are actually cached in memory
Follow up 236fc19121 with a ClangImporter
test that we get the PCH written by this process even if it has been
replaced on disk.
2019-03-13 13:16:25 -07:00
Adrian Prantl
4b1532cddc Rename swift::Demangle::archetypeName() to swift::Demangle::genericParameterName(). 2019-03-01 08:02:28 -08:00
swift-ci
bd8890aca5 Merge pull request #22954 from adrian-prantl/48259889 2019-02-28 18:20:11 -08:00
Adrian Prantl
b36c646914 Allow for passing a custom Archetype naming schema to the demangler.
LLDB would like to substitute the original Archetype names from the
source code when demangling symbols instead of the confusing generic
'A', 'B', ...

<rdar://problem/48259889>
2019-02-28 14:01:38 -08:00
Saleem Abdulrasool
4b9f8464e4 unittests: add a hack to use the host compiler
Unfortunately, ASAN breaks with the just built compiler.  The runtime
and the runtime tests should really use the same compiler.  As a
workaround, if the host compiler is clang, just use that for the time
being.  This should fix the build on the ASAN bots.
2019-02-27 11:37:45 -08:00
Saleem Abdulrasool
27fab1d582 build: use the just-built clang for runtime unittests
The runtime is meant to be built with the just built clang (as this
absolutely requires clang) as the runtime is a target library.  The host
tools can be built with the host compiler.  Swap out the compiler for
the unittests as we do for the runtime itself.
2019-02-25 16:13:12 -08:00
Saleem Abdulrasool
9897716e4b unittests: fixes for Swift's custom build system
Because we do not have proper libraries in our system, we cannot attach
interface link libraries, especially in light of the
incorporate_object_library implementation.  Explicitly add the
dependency on DbgHelp for the unit tests.
2019-02-21 22:39:00 -08:00
Mike Ash
82c33dc031 Merge pull request #22590 from mikeash/remote-mirror-interop-is-swift-mask
[RemoteMirror] Add a call to the interop header to set the upcoming classIsSwiftMask value.
2019-02-21 09:39:34 -05:00
eeckstein
0b32db04ae Merge pull request #22715 from eeckstein/demangler-get-module
Demangler library: add a function swift_demangle_getModuleName  to get the module name of a mangled symbol.
2019-02-20 10:14:22 -08:00
Erik Eckstein
706f4c8622 Demangler library: add a function swift_demangle_getModuleName to get the module name of a mangled symbol.
rdar://problem/47560963
2019-02-19 11:26:42 -08:00
Saleem Abdulrasool
d30a2ababd FrontendTool: fix escaping of filenames in Makefile
The dependency file that is being generated should not escape : and # in
the filename.  This makes the behaviour of the filename escaping similar
to clang and GCC and fixes incorrect quoting of paths on Windows.
2019-02-19 10:51:26 -08:00
Mike Ash
2b89074944 [RemoteMirror] Add a call to the interop header to set the upcoming classIsSwiftMask value. 2019-02-13 14:59:05 -05:00
Rintaro Ishizaki
6aee036812 Merge pull request #22214 from bannzai/syntax/add/function/make_ellipsis_token
[SwiftSyntax] Add SyntaxFactory.makeEllipsisToken function.
2019-02-11 16:27:37 -08:00
John McCall
d07efd37e0 Requestify the mangling-to-metadata APIs.
Note that I've called out a couple of suspicious places where we
are requesting abstract metadata for superclasses but probably
need to be requesting something more complete.
2019-02-05 16:20:48 -05:00
John McCall
de4564877a Separate CC attrs in the compatibility-override macro; NFC. 2019-02-05 16:20:48 -05:00
Slava Pestov
13a50c2d2d ASTDemangler: Add support for lowered metatypes 2019-01-29 19:15:17 -05:00
bannzai
f425c39e60 Add FunctionParameterWithEllipsis test case 2019-01-30 02:26:33 +09:00
Slava Pestov
bbe6a56e22 ASTDemangler: Implement builtin types 2019-01-25 21:44:02 -05:00
Saleem Abdulrasool
159b4ef6c8 Merge pull request #22058 from compnerd/chrono
SourceKit: use `std::chrono` in unittests
2019-01-23 16:47:02 -08:00
Saleem Abdulrasool
2bc1ec5650 SourceKit: use std::chrono in unittests
Rather than using the `usleep` function which is both deprecated and
non-portable (does not exist on Windows), prefer using the C++11 chrono library
for the sleep.  This also allows us to use the UDL to simplify the code rather
than relying on the comments.  NFCI
2019-01-23 14:00:51 -08:00
Saleem Abdulrasool
2b45eb9575 SourceKit: simplify and modernise CMake for tests
Use `target_compile_definitions` to fix the quoting.  This is particularly
important when running under a non-sh shell (e.g. Windows) where the quoting
rules are different.
2019-01-23 09:52:41 -08:00