Commit Graph

1938 Commits

Author SHA1 Message Date
Jordan Rose
ac4a92a968 Merge pull request #19292 from jrose-apple/get-out-the-map
Minor improvements to the use of StringMap/StringSet
2018-09-14 10:52:59 -07:00
Graydon Hoare
5a563f59af [Stats] Add SWIFTC_MAXIMUM_DETERMINISM to inhibit parallelism everywhere. 2018-09-13 16:15:49 -07:00
Jordan Rose
71760bcc4e Replace StringMap with DenseMap when the keys don't need to be owned
StringMap always copies its strings into its own storage. A DenseMap
of StringRefs has the same caveats as any other use of StringRef, but
in the cases I've changed the string has very clear ownership that
outlives the map.

No functionality change, but should reduce memory usage and malloc
traffic a little.
2018-09-13 15:15:27 -07:00
Mark Lacey
1e7dae3741 Merge pull request #19145 from rudkx/parse-designated-protocol
Add support for parsing designated protocols in operator declarations.
2018-09-06 22:01:02 -07:00
Xi Ge
b4356d4f93 Merge pull request #19104 from nkcsgexi/parser-laziness
Parser: lazily parse members in extension decls.
2018-09-06 15:24:17 -07:00
Xi Ge
7379bc5782 Add counter for parsed decl lists. 2018-09-06 11:44:49 -07:00
Doug Gregor
cffe3869a6 Merge pull request #19034 from DougGregor/protocol-override
Introduce overrides of protocol members and drop them from witness tables
2018-09-05 20:57:21 -07:00
swift-ci
6f3b6182bc Merge pull request #15665 from graydon/everybody-gets-a-tracer 2018-09-05 00:46:20 -07:00
Mark Lacey
ae84ac81d4 Add a frontend option to enable parsing "operator protocol designators". 2018-09-04 23:10:30 -07:00
Doug Gregor
e670ac42d9 Add command-line option -warn-implicit-overrides.
When provided, this flag warns about implicit overrides, where a
declaration overrides another declaration but is not marked with the
‘override’ keyword. The warning can be suppressed by either providing
‘override’ or ‘@_nonoverride’.

At present, this only happens with overrides in protocols.
2018-09-04 16:42:06 -07:00
Graydon Hoare
388e357218 [Stats] Add UnifiedStatsReporter tracing/profiling machinery to request-evaluator. 2018-09-02 02:00:07 -07:00
Saleem Abdulrasool
361f8dd859 Merge pull request #19099 from compnerd/use-after-move
Basic: correct use-after-move on Windows
2018-09-01 10:18:05 -07:00
Graydon Hoare
1c87229104 [Stats] Flush Stats profiles and tracers at SILModule lifecycle boundary. 2018-09-01 00:05:58 -07:00
Graydon Hoare
044157821e [Stats] Assert main-thread-only use of UnifiedStatsReporter. 2018-09-01 00:05:58 -07:00
Graydon Hoare
efa0594332 [Stats] Recommend against using raw SharedTimers. 2018-09-01 00:05:58 -07:00
Graydon Hoare
ffa1bf1979 [Stats] Expand and improve traceable-entity vocabulary. 2018-09-01 00:05:58 -07:00
Harlan
dc1bc823e6 [InterfaceGen] Remove #ifs from default arguments (#19075)
* [InterfaceGen] Remove #ifs from default args

This patch removes all #if configs form the bodies of default arguments,
which can contain multiline closures, while preserving the bodies of the
clauses that are active.

This code is generalized and should "just work" for inlinable function
bodies, which will come in a later patch.

* Address review comments

* Fix and test CharSourceRange.overlaps

* Fix CharSourceRange::print to respect half-open ranges
2018-08-31 20:18:48 -07:00
Saleem Abdulrasool
3f5c245d7f Basic: correct use-after-move on Windows
The order of evaluation for arguments is underspecified in the language
specification.  It is permissible to evluate right to left, resulting in the use
after the move of the OwnedPtr.  This happens in practice on Windows.  Alter the
construction to avoid this.
2018-08-31 16:03:50 -07:00
swift-ci
88c41c6560 Merge pull request #19072 from graydon/sometimes-a-memory-aint-enough 2018-08-30 17:46:44 -07:00
Graydon Hoare
fb7e7eb028 [Stats] Add statistic for Frontend.MaxMallocUsage. 2018-08-30 14:54:26 -07:00
Jordan Rose
2f6b4cdbe8 Merge pull request #19054 from jrose-apple/nocturnal
Honor #sourceLocation filenames in several more places
2018-08-30 13:02:50 -07:00
Brent Royal-Gordon
0412f61c35 [Basic] Use memcpy() for a possibly unaligned copy
ExponentialGrowthAppendingBinaryByteStream::writeRaw() is sometimes used for unaligned writes, so it shouldn’t be casting and dereferencing pointers. Tests in Godbolt indicate that the call to memcpy() is optimized into similar instructions anyway.
2018-08-29 22:53:40 -07:00
Jordan Rose
4a93ab56e9 Remove SourceManager::getBufferIdentifierForLoc
And tidy up doc comments for other methods that do or don't respect
'#sourceLocation'.

'getBufferIdentifierForLoc' is no longer useful: it doesn't
consistently return either the name of an actual buffer or the name of
a file suitable for diagnostics. As seen in the previous commit, all
remaining uses of it were wrong anyway. Remove it.
2018-08-29 11:46:41 -07:00
Xi Ge
3510f082e3 Merge pull request #19035 from nkcsgexi/refactor-graph-viz
[Evaluator] Refactor evaluator's GraphViz output to the destructor of the ASTContext. NFC
2018-08-29 10:49:54 -07:00
Xi Ge
81151da764 Merge pull request #19005 from nkcsgexi/request-usr-gen
IDE: refactor USR generation to request evaluator model.
2018-08-29 10:49:34 -07:00
Xi Ge
ce29c64964 [Evaluator] Refactor evaluator's GraphViz output to the destructor of the evaluator. NFC
This allows us to output dependency-graph while using the compiler in
other tools, like swift-ide-test, sourcekitd-test, etc.
2018-08-28 18:16:44 -07:00
Xi Ge
dd5f21b1d2 IDE: refactor USR generation to request evaluator model.
We refactor the existing USR generation code to use the request evaluator
model. Most part of this patch is NFC, however a slight difference is
using this model allows us to cache the calculated USRs in the evaluator.
2018-08-28 11:03:25 -07:00
Jordan Rose
e224e31720 Break almost all dependencies of Driver on Frontend
- Sink OutputFileMap{.h,.cpp} and ReferenceDependencyKeys.h to Basic
- Remove unnecessary includes of Frontend.h.
2018-08-27 20:47:58 -07:00
Alex Hoppen
33d86d5cb6 [byteTree] Write fixed sized data using an optimized form
If we know the size of a type at compile time (like we do for all the
integer types), it is cheaper to assign the data buffer directly instead
of using a memcpy.
2018-08-24 15:27:23 -07:00
Alex Hoppen
f97d13d984 Merge pull request #18889 from ahoppen/bytetree-forward-compatible
[libSyntax] Make the ByteTree format forwards-compatible
2018-08-24 10:47:26 -07:00
Alex Hoppen
49f2e14094 [swiftBasic] Use a SmallVector as the underlying storage for ExponentialGrowthAppendingBinaryByteStream 2018-08-23 09:00:27 -07:00
Alex Hoppen
ff68452301 [swiftBasic] Introduce an exponentially growing appending binary stream
It is more efficient than llvm::AppendingBinaryByteStream if a lot of
small data gets appended to it because it doesn't need to resize its
buffer on each write.
2018-08-23 08:14:02 -07:00
Alex Hoppen
34a89d45e2 [libSyntax] Make the ByteTree format forwards-compatible 2018-08-22 12:07:57 -07:00
John McCall
fae2ec3b38 Assorted minor improvements to the cleanup system. 2018-08-22 01:55:10 -04:00
Alex Hoppen
9eb0208bb5 [libSyntax] Add support for incremental serialization of ByteTrees 2018-08-21 10:55:15 -07:00
Slava Pestov
c71f1e422b RelativePointer::operator() should be const 2018-08-20 16:23:07 -07:00
Michael Gottesman
a57ad403ec [silgen] Now that we have destructure, use it in RValue to reduce copies emitted by SILGen.
rdar://43493020
2018-08-20 08:52:51 -07:00
Michael Gottesman
91cb323b2b [gardening] Inject llvm::SmallSetVector into the swift namespace. 2018-08-18 10:32:42 -07:00
Graydon Hoare
fe5667a4b6 [Stats] Change NumInstructions to NumInstructionsExecuted, accept 0 when on VMs. 2018-08-16 13:19:36 -07:00
Alex Hoppen
79e9113a58 Merge pull request #18677 from ahoppen/ref-counted-owned-string
[libSyntax] Add a reference counted version of OwnedString
2018-08-14 11:37:40 -07:00
Alex Hoppen
4369b36f21 Merge pull request #18497 from ahoppen/bytetree-infrastructure
[libSyntax] Add a binary serialization format for syntax trees
2018-08-13 15:41:30 -07:00
Alex Hoppen
ac512d4341 [libSyntax] Add a reference counted version of OwnedString
We cannot use unowned strings for token texts of incrementally parsed
syntax trees since the source buffer to which reused nodes refer will
have been freed for reused nodes. Always copying the token text whenever
OwnedString is passed is too expensive. A reference counted copy of the
string allows us to keep the token's string alive across incremental
parses while eliminating unnecessary copies.
2018-08-13 15:37:53 -07:00
Graydon Hoare
bdb00fceb0 Add Frontend.NumInstructions statistic, populated on macOS by rusage_info_v4. 2018-08-11 23:28:57 -07:00
Alex Hoppen
280b186fa0 [libSyntax] Add a binary serialization format for syntax trees 2018-08-10 10:13:00 -07:00
Jordan Rose
fc9ea1e329 Add Lexer::IsHashbangAllowed, drop SourceManager::getHashbangBufferID (#18534)
Having this be a single buffer hardcoded in the SourceManager and set
by all clients is silly. SourceFiles with the 'Main' kind are allowed
to have hashbang lines (`#!`), other files are not. And anyone
manually setting up a Lexer can decide for themselves.

No intended behavioral change.
2018-08-07 08:25:05 -07:00
Mark Lacey
df923d9660 Merge pull request #18522 from rudkx/disable-perf-hacks
[ConstraintSystem] Add an option to disable the constraint solver per…
2018-08-06 15:42:20 -07:00
Mark Lacey
3c9cb97c86 [ConstraintSystem] Add an option to disable the constraint solver perf hacks.
This is helpful in experimenting with constraint solver changes that
might help us remove some of these unsound options. It's not ever mean
to be enabled, but if we're able to remove the things guarded by the
option we can eventually remove the option.
2018-08-06 11:48:19 -07:00
swift-ci
71f0248b0a Merge remote-tracking branch 'origin/master' into master-next 2018-08-06 11:07:55 -07:00
swift-ci
db1fb38af5 Merge pull request #18417 from mhong/denseinfo_source_range 2018-08-05 19:54:21 -07:00
Mingsheng Hong
83d4bcae38 Fixed compilation errors. 2018-08-03 10:56:30 -07:00