Commit Graph

1213 Commits

Author SHA1 Message Date
Joe Groff
b00ea61945 SILGen: Lower keypath references to other modules' properties and subscripts as external keypath components.
This way we'll link against the key path component the other module provides instead of making fragile assumptions about its current implementation. Since external keypath lowering isn't fully implemented elsewhere in the compiler, this is enabled behind a staging flag.

external keypath staging
2018-02-23 12:58:19 -08:00
Graydon Hoare
628c446fe3 [Stats] Add -profile-stats-{events,entities} 2018-02-21 16:22:48 -08:00
Graydon Hoare
7fe97c77c5 [Stats] Permit negative counters and deltas. 2018-02-21 14:49:24 -08:00
Graydon Hoare
dd85e946e7 [Stats] Replace nonstandard SharedTimers with FrontendStatsTracers. 2018-02-21 14:49:24 -08:00
Graydon Hoare
819275945d [Stats] Replace RecursiveSharedTimer with FrontendStatsTracer. 2018-02-21 14:49:24 -08:00
Graydon Hoare
deabc3fe65 [Stats] Add a recursive-timers registry to UnifiedStatsReporter. 2018-02-21 14:49:24 -08:00
Graydon Hoare
5f01c19d8e [Stats] Add support for tracing protocol conformances. 2018-02-21 14:49:24 -08:00
Graydon Hoare
76b82accbc [Stats] Simplify FrontendStatsTracer uses and formatter-definitions. 2018-02-21 14:49:24 -08:00
David Ungar
e7ba87f613 Merge pull request #14230 from davidungar/PR-18-5-lldb-interface
[Batch Mode] Pass PrimarySpecificPaths through compiler. (4)
2018-02-15 23:09:46 -07:00
Graydon Hoare
7686a5af20 [BatchMode] Fix a bug in DummyTaskQueue uncovered by recent change. 2018-02-15 15:38:09 -08:00
David Ungar
dec78900cd Only use supplementary outputs for first parallel-generated input. 2018-02-15 15:34:55 -07:00
David Ungar
1f9a4f3591 Pass around arguments for primary-specific filenames.
Get rid of IRGenOpts attributes that won’t work for batch mode and also remove fakeNamesStub.
2018-02-15 15:34:55 -07:00
David Ungar
1e32ff31b7 Move SupplementaryOutputPaths to Basic. 2018-02-15 15:32:26 -07:00
Ron Olson
b96b7c3306 Fix for SR-6986; Swift does not build with Clang 6 (#14589)
Added decrement operators for the ArrayRefView class
2018-02-13 18:20:00 -08:00
Xi Ge
37f352fe41 sourcekitd: build Swift syntax tree more lazily than collecting parsed tokens. (#14578)
Before this patch, we have one flag (KeepSyntaxInfo) to turn on two syntax
functionalities of parser: (1) collecting parsed tokens for coloring and
(2) building syntax trees. Since sourcekitd is the only consumer of either of these
functionalities, sourcekitd by default always enables such flag.
However, empirical results show (2) is both heavier and less-frequently
needed than (1). Therefore, separating the flag to two flags makes more
sense, where CollectParsedToken controls (1) and BuildSyntaxTree
controls (2).

CollectingParsedToken is always enabled by sourcekitd because
formatting and syntax-coloring need it; however BuildSyntaxTree should
be explicitly switched on by sourcekitd clients.

resolves: rdar://problem/37483076
2018-02-13 16:27:12 -08:00
Mark Lacey
37009b0d8b [ConstraintSystem] Remove constraint propagation.
The current implementation isn't really useful in the face of generic
overloads. It has never been enabled by default, and isn't useful to
keep around if it is disabled. If we ever want to bring it back,
we know where to look!
2018-02-12 21:30:39 -08:00
Erik Eckstein
7ddfa9a9b6 mangling: remove the round-trip check for mangled runtime names (in the old mangling scheme).
This check doesn't make sense anymore because we are still making changes to the old remangler, but not to the old demangler.
Also, this check didn't work in most cases anyway.

rdar://problem/37241935
2018-02-05 14:02:18 -08:00
Davide Italiano
caa4ab3b70 Merge pull request #14262 from graydon/reduce-layering-violation-in-stats-tracer
[Stats] Reduce layering violations in FrontendStatsTracer.
2018-01-30 08:23:34 -08:00
Joe Groff
fdef6ef15f Merge pull request #13468 from jckarter/generic-requirement-details
Context descriptors
2018-01-30 06:49:16 -08:00
Graydon Hoare
9334779f33 [Stats] Reduce layering violations in FrontendStatsTracer. 2018-01-30 01:54:07 -08:00
Rintaro Ishizaki
4087cff99d [JSONSerialization] Add ability to emit 'null' value 2018-01-30 15:23:12 +09:00
Joe Groff
a7a3b17597 Replace nominal type descriptors with a hierarchy of context descriptors.
This new format more efficiently represents existing information, while
more accurately encoding important information about nested generic
contexts with same-type and layout constraints that need to be evaluated
at runtime. It's also designed with an eye to forward- and
backward-compatible expansion for ABI stability with future Swift
versions.
2018-01-29 16:19:25 -08:00
Graydon Hoare
5f130a8d35 [Stats] Expand FrontendStatsTracer to trace multiple entity-types. 2018-01-21 23:37:54 -08:00
Xi Ge
71af76a87e libSyntax: optionally emit diagnostics for unknown expressions and declarations. (#13973)
With more syntax nodes being specialized, we'd like this
straight-forward way to pinpoint unknown entities. This diagnostics
is only issued in -emit-syntax frontend action and swift-syntax-test
invocation.
2018-01-16 16:14:57 -08:00
John McCall
b80808bbc1 Make it easier to define an ExternalUnion where the kind type is
just used to select the union storage, rather than having any
external meaning.
2018-01-09 01:15:01 -05:00
David Zarzycki
dc43a4a51f [AST] NFC: Feedback from Jordan 2018-01-08 21:01:01 -05:00
David Zarzycki
1ebc8e95f7 Merge pull request #13691 from davezarzycki/nfc_perf_getDesugaredType2
[AST] Perf: Improve getDesugaredType() efficiency
2018-01-03 17:20:01 -05:00
Doug Gregor
0632d8763a Merge pull request #13685 from DougGregor/protocol-conformance-record-cleanup
[Runtime] Improve representation of protocol conformance records
2018-01-03 14:11:00 -08:00
Doug Gregor
aee0c681e4 [Runtime] Pack TypeMetadataRecordKind into spare bits of protocol conformances
Use the spare bits within the type reference field to describe the kinds
of type metadata records, so that we no longer need to rely on a
separate "flags" field.
2018-01-03 09:23:31 -08:00
David Zarzycki
77a29c9551 [AST] Perf: Improve getDesugaredType() efficiency
Make getDesugaredType() as fast as possible for now. With the old way:

1) Switching over the sugared types turned into a frequently
   mispredicted branch because the sugar in the type system is random
   as far as the processor is concerned.
2) Storing the underlying/singlely-desugared type at different offsets
   in memory adds more code bloat and misprediction.

Short of a major redesign to avoid pointer chasing, this is probably as
fast as the method will get.
2018-01-03 09:45:48 -05:00
Slava Pestov
6af8d18a00 IRGen: Remove -enable-class-resilience staging flag 2018-01-03 00:26:10 -08:00
Doug Gregor
7e6f52308d [Runtime] Move conformance kind into low bits of witness table reference.
Move the 2-bit conformance reference kind from the conformance flags (which
is meant to go away) into the lower two bits of the witness table offset.
2018-01-02 12:34:06 -08:00
David Zarzycki
2c840a9a22 [AST] Perf: targeted use of __builtin_assume() in dyn_cast wrappers
Workaround:
https://bugs.llvm.org/show_bug.cgi?id=35790
See also:
https://bugs.llvm.org/show_bug.cgi?id=28430
2018-01-02 07:22:55 -05:00
swift-ci
d2dc653420 Merge pull request #13637 from davezarzycki/sil_nfc_remove_boilerplate3 2017-12-28 08:46:48 -08:00
David Zarzycki
68c696dbc1 [SIL] NFC: Replace boilerplate projection with swift::ArrayRefView 2017-12-28 09:51:29 -05:00
David Zarzycki
da238539f5 [Basic] NFC: Inline bitfield cleanup
1) Remove SWIFT_INLINE_BITS boilerplate. Now that we're not using anonymous/transparent unions, we don't need the
SWIFT_BITFIELD_BITS macro.
2) Refine the the bitfield size check to better support templated bitfields.
3) Refine the SIL templated bitfields to not be prematurely "full".
2017-12-28 09:20:31 -05:00
Greg Parker
c677a5dc11 [IRGen][runtime] Prepare to change the is-Swift bit in class metadata. (#13595)
Swift class metadata has a bit to distinguish it from non-Swift Objective-C
classes. The stable ABI will use a different bit so that stable Swift and
pre-stable Swift can be distinguished from each other.

No bits are actually changed yet. Enabling the new bit needs to wait for
other coordination such as libobjc.

rdar://35767811
2017-12-22 00:52:00 -08:00
swift-ci
adf83617ec Merge pull request #13526 from DougGregor/remove-conditional-conformances-flag 2017-12-19 11:17:44 -08:00
Doug Gregor
5c831a71ee Revert "[SE-0143] Put conditional conformances behind an "experimental" flag."
This reverts commit b59c30c1af.
2017-12-18 22:54:31 -08:00
Ben Langmuir
122df2b00d Merge pull request #13510 from benlangmuir/cc-call-pattern-option
[code-complete] Try to make call-pattern completions usable again
2017-12-18 17:03:12 -08:00
David Zarzycki
54ea315586 [Basic] NFC: Stop using transparent unions 2017-12-16 10:43:49 -05:00
Ben Langmuir
93956eb34b [code-complete] Put call-pattern heuristics under a flag
The original hope was we could make these heuristics really good, but
since that is not currently in sight (and may never be), we want to be
able to turn them off.  For now, just plumb through an internal flag to
control the behaviour.  A future change will customize the behaviour in
SourceKit.

rdar://31113161
2017-12-15 13:23:44 -08:00
David Zarzycki
68a846e761 [AST] NFC: Do not hard code bit size of 'Kind' field
Also, give each class hierarchy at least 8 bits for the 'Kind' field.
In practice, no class hierarchy has more than 256 nodes, so this
optimizees code generation to make isa/dyn_cast faster.
2017-12-15 14:45:38 -05:00
David Zarzycki
97541e0d1e [Basic] NFC: Standardize and simplify inline bitfields
Inline bitfields are a common design pattern in LLVM and derived
projects, but the associated boilerplate can be demotivating and
brittle. This new header makes it easier to define and use inline
bitfields in Swift.

This also reorders some fields for better code generation.
2017-12-15 14:14:59 -05:00
Mark Lacey
d8f492e5d7 Squelch some warnings.
Fix up some dead code warnings as well as a warning for testing
whether an unsigned number is non-negative (which it always is).
2017-12-10 15:21:19 -08:00
Graydon Hoare
3726e69852 [NamedLazyMemberLoading] Flip flag polarity: on by default, optionally off. 2017-12-01 16:52:25 -08:00
Arnold Schwaighofer
eba12a7c3e Revert "Finish and default-enable named lazy member loading" 2017-12-01 07:25:54 -08:00
swift-ci
7e6f7e1c04 Merge pull request #12843 from graydon/force-on-named-lazy-member-loading 2017-12-01 02:32:10 -08:00
Graydon Hoare
3de4297c91 [NamedLazyMemberLoading] Flip flag polarity: on by default, optionally off. 2017-11-30 22:01:05 -08:00
Ted Kremenek
e04c7fd00a Merge pull request #12964 from graydon/if-target-environment
#if targetEnvironment(simulator)
2017-11-28 19:39:44 -08:00