Skip to content

merge 'swift-DEVELOPMENT-SNAPSHOT-2019-05-26-a' into 'tensorflow' #25110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 207 commits into from
May 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
207 commits
Select commit Hold shift + click to select a range
70b36fe
[SourceKit] Fail requests when an error occurs
DavidGoldman Apr 18, 2019
aad8609
Add InternalDiagnostic to CursorInfoData and NameTranslatingInfo
DavidGoldman Apr 19, 2019
10ecea6
[SourceKit] Fail requests when an error occurs
DavidGoldman Apr 18, 2019
a3a4d2d
Add InternalDiagnostic to CursorInfoData and NameTranslatingInfo
DavidGoldman Apr 19, 2019
00d771c
RequestResult class and Pass*InfoForDecl fixes
DavidGoldman May 3, 2019
970ffab
Merge branch 'master' of https://github.com/apple/swift
DavidGoldman May 3, 2019
9a9854b
Merge
DavidGoldman May 3, 2019
6d59776
Fix bad merge
DavidGoldman May 3, 2019
7d0b78d
[android] Stop leaking FDs in parent test process.
drodriguez May 6, 2019
6eead16
[gardening] Remove unnecessary breaks
ikesyo May 14, 2019
1e3317b
[Test] Conditionalize KVOKeyPaths tests that only work with Swift 5.1
bob-wilson May 16, 2019
d3262ec
[IRGen] Remove SetBitEnumerator from ClusteredBitVector
mundaym May 15, 2019
c93c8e4
[Test] Fix backtrace.swift to use %target-run.
mikeash May 17, 2019
7561f95
Test foreign strings on invalid content more thoroughly
Catfish-Man May 17, 2019
5c3a4d3
Fix dynamic replacement of some type when used with associated types
aschwaighofer May 14, 2019
72f8249
Print build-script notes to stderr
beccadax May 18, 2019
26c7f5c
Make --expand-build-script-invocation scriptable
beccadax May 18, 2019
85b30c3
Add --print-build-dir option to build-script
beccadax May 18, 2019
5910829
[constant-prop] When replacing uses of destructure_tuple, only RAUW i…
gottesmm Apr 15, 2019
7a8b3c8
Add trailing quote location to interpolated string literal.
May 19, 2019
b388346
Provide shorter name for --expand-build-script-invocation
beccadax May 19, 2019
af7e2da
Replace —print-build-dir with --dump-config
beccadax May 20, 2019
7f4f573
[Test] Upgrade the all backtrace tests to use not.py and %target-run.
mikeash May 20, 2019
d86907e
[Property delegates] Fix crash involving generic uses of delegateValue.
DougGregor May 20, 2019
92fd649
Use CloseQuoteBegin
May 20, 2019
fb268e5
handle diags that happen during repl code completion
Feb 13, 2019
e64ebad
Add explanation.
May 20, 2019
d37fd2f
Revised test.
May 20, 2019
3bdff36
[preset] Fix macOS full test preset to include sourcekit-lsp
benlangmuir May 20, 2019
3b02901
[mandatory-inlining] When using the linear lifetime checker to insert…
gottesmm May 20, 2019
d15a651
[Test] Disable existentials_objc.swift when testing against OS librar…
mikeash May 20, 2019
1499811
[Diagnostics] Fix incorrect metatype check which leads to crashes
xedin May 20, 2019
6cf09fa
Merge pull request #24905 from davidungar/interpolated-string-literal…
May 20, 2019
9681c3b
Add isDecl check.
May 20, 2019
4912e6a
CapturePromotion: Disable for dynamically_replaceable sil functions
aschwaighofer May 20, 2019
6c0baae
Fix closurescope analysis
aschwaighofer May 20, 2019
ce61dfe
[Diagnostics] NFC: Couple of small cleanups for invalid member ref
xedin May 20, 2019
ad79bba
Merge pull request #22591 from apple/marcrasi-repl-code-completion-diags
May 20, 2019
31d001c
[CSDiag] Adjust assert to account for changes in `filterContextualMem…
xedin May 20, 2019
eb609d0
Address review comment
aschwaighofer May 20, 2019
5b2211d
Serialization: Recover from failure to deserialize inheritance clause…
slavapestov May 20, 2019
7122860
Remove dead code.
May 20, 2019
1db75d6
Merge pull request #24920 from gottesmm/pr-1ce3bba234b68150bc0675d364…
gottesmm May 20, 2019
d6c3d92
[win] Fix path separators for Windows.
drodriguez May 20, 2019
ef1ad06
Merge pull request #24102 from gottesmm/pr-cdde379c40f94a6fd49361a2b3…
gottesmm May 20, 2019
b896361
IRGen: Map type into context before asking for class layout.
jckarter May 20, 2019
fe9b48c
Merge pull request #24922 from davidungar/isDiag
May 20, 2019
464761e
Merge pull request #24924 from xedin/rdar-50679161
xedin May 20, 2019
7511e0a
Merge pull request #24926 from xedin/rdar-50668864
xedin May 20, 2019
a14883c
Merge pull request #24916 from benlangmuir/sourcekit-lsp-doesnt-need-…
benlangmuir May 20, 2019
9d22cbb
[test] Mark mandatory_inlining.swift as executable.
drodriguez May 21, 2019
4e00cad
Add a comment in ClosureScopeAnalysis.
atrick May 21, 2019
4868824
[Diagnostics] Add known member declaration to `invalid member ref` di…
xedin May 21, 2019
1ca8e83
Sourcekit/DocSupport: fix an assertion when generating documentation …
nkcsgexi May 21, 2019
84565dd
Merge pull request #24931 from drodriguez/windows-source-locs
drodriguez May 21, 2019
69776aa
Merge pull request #24521 from drodriguez/android-stop-leaking-fds
drodriguez May 21, 2019
33573aa
Merge pull request #24935 from drodriguez/android-mark-executable-man…
drodriguez May 21, 2019
e858867
Merge pull request #24939 from nkcsgexi/doc-support-issue
nkcsgexi May 21, 2019
deea9b1
Merge pull request #24933 from jckarter/keypath-class-access
jckarter May 21, 2019
93293c7
Merge pull request #24912 from slavapestov/drop-inherited-clause-entries
slavapestov May 21, 2019
a3de97b
Add SILParser support for [dynamically_replaceable].
atrick May 21, 2019
ca5b94f
[Frontend] Re-add FrontendObserver methods (#24917)
May 21, 2019
6e3f56f
Fix exclusivity diagnostics to be aware of [dynamically_replaceable].
atrick May 21, 2019
528fe42
Merge pull request #24923 from aschwaighofer/dynamically_replaceable_…
aschwaighofer May 21, 2019
6746911
[Test] Add availability to the GenericMangled test in objc_getClass.s…
mikeash May 21, 2019
1c81982
Comment and sourcekitd-test fixes
DavidGoldman May 21, 2019
8c1a1dc
Merge pull request #24921 from mikeash/existentials-objc-test-disable…
mikeash May 21, 2019
25c4183
[test] Make sure to ship over the dylib over for the switch_resilienc…
gottesmm May 21, 2019
748bf88
[ownership] Convert SILOptimizer/cast_folding.swift to work with owne…
gottesmm May 20, 2019
b48bcd9
[ownership] Convert SILOptimizer/cast_folding_objc_generics.swift to …
gottesmm May 21, 2019
2e12ac8
Merge pull request #24836 from bob-wilson/rdar50173830
bob-wilson May 21, 2019
5f8a505
DeadObjectElimination: remove dead keypath instructions
eeckstein May 20, 2019
da38e3a
SILCombine: optimize keypath instructions.
eeckstein May 20, 2019
b170ad7
Merge pull request #24953 from gottesmm/pr-71990c28f613fe44d9bf454eeb…
swift-ci May 21, 2019
a96890c
Merge pull request #24929 from eeckstein/optimize-keypath
swift-ci May 21, 2019
866e8f5
[Diagnostics] Let `invalid member ref` carry member declaration inste…
xedin May 21, 2019
3a3e409
Merge pull request #24952 from gottesmm/pr-6da93287e2d5c030e12989e4f9…
gottesmm May 21, 2019
17213f7
Merge pull request #24955 from gottesmm/pr-e299d5c0fc06f6cf982d906b63…
gottesmm May 21, 2019
803227a
Avoid O(n) character accesses in String.UTF8View._foreignCount
Catfish-Man Apr 30, 2019
22c0995
Allow non-@objc ‘dynamic’ in all language modes.
DougGregor May 21, 2019
5bcdb3c
[Test] Disable inherits_ObjCClasses.swift on watchOS.
mikeash May 21, 2019
81c7f84
IRGen: Work around JIT bug with GOT equivalents.
jckarter May 21, 2019
6363961
Split up a couple more tests into stable and pre-stable ABI deploymen…
slavapestov May 21, 2019
5fba88c
Merge pull request #24386 from Catfish-Man/noble-from-a-distant-land
Catfish-Man May 21, 2019
19cc42b
Merge pull request #24913 from DougGregor/property-delegates-generic-…
DougGregor May 21, 2019
af7b461
Merge pull request #24959 from DougGregor/non-objc-dynamic-everywhere
DougGregor May 21, 2019
33410bc
Merge pull request #24857 from linux-on-ibm-z/gather-scatter
jckarter May 21, 2019
fc0ab61
Merge pull request #24937 from xedin/rdar-50909555
xedin May 21, 2019
83084e2
[CodeCompletion] Suggest 'file', 'line', et al. after #
rintaro May 20, 2019
3c957de
[CodeCompletion] Use CompletionLookup.CurrModule instance property
rintaro May 21, 2019
e2a4621
[CodeCompletion] Suggest #selector and #keyPath after # only if appli…
rintaro May 21, 2019
c001483
[CodeCompletion] Added test case for polymorphic type keywords
rintaro May 22, 2019
b21774b
[Tests] Update the ParseableInterface tests to use make-old.py due to…
shahmishal May 22, 2019
b8eca81
Update the swift-5.1-branch-04-24-2019 scheme for swift-syntax
shahmishal May 22, 2019
c0b0536
Merge pull request #24970 from apple/update-parseableinterface-tests
swift-ci May 22, 2019
3a1771c
Merge pull request #24944 from jckarter/keypath-jit-workaround
jckarter May 22, 2019
9b4f05d
Merge pull request #24964 from slavapestov/more-test-stable-abi-tweaks
slavapestov May 22, 2019
081e1c9
[benchmark] Add unit test for single table report
palimondo May 22, 2019
930e0b9
Merge pull request #24950 from mikeash/objc-getclass-disable-conditio…
mikeash May 22, 2019
cdda989
Merge pull request #24962 from mikeash/inherits-objccclasses-disable
mikeash May 22, 2019
253d5b5
[IRGen] Simplify constant occupied/spare bit interleaving
mundaym May 22, 2019
56924d4
Document dynamic_function_ref and prev_dynamic_function_ref
aschwaighofer May 22, 2019
31200dd
Merge pull request #24864 from mikeash/backtrace-target-run-fix
mikeash May 22, 2019
a79fadc
Merge pull request #24969 from rintaro/ide-completion-poundfile-rdar4…
rintaro May 22, 2019
4873f6c
Fix assert
aschwaighofer May 22, 2019
bdf7b2a
Merge pull request #24947 from atrick/fix-dynamic-exclusivity
atrick May 22, 2019
df2afaa
Merge pull request #24936 from atrick/comment-closure-scope
atrick May 22, 2019
729a955
Merge pull request #24124 from DavidGoldman/master
akyrtzi May 22, 2019
bf418eb
Merge pull request #24979 from aschwaighofer/document_dynamic_functio…
atrick May 22, 2019
0297476
Add missing swiftrt-coff change
aschwaighofer May 22, 2019
d8a7c5a
[Tests] Pass -r to sftp in remote-run.
mikeash May 22, 2019
d3a192f
SourceKit/SyntaxMap: properly handle object literal syntax for highli…
nkcsgexi May 22, 2019
3c0732a
Add regression test for SR-10264
jckarter May 22, 2019
7d54810
Revert "[SourceKit] Fail requests when an error occurs"
jckarter May 22, 2019
3847dbc
Merge pull request #24993 from apple/revert-24124-master
jckarter May 22, 2019
4bb3fc9
[Tests] Update the ParseableInterface tests to use make-old.py due to…
shahmishal May 22, 2019
d9700de
Placate linter
beccadax May 22, 2019
2dcd822
Merge pull request #24874 from Catfish-Man/bulk-tests
Catfish-Man May 22, 2019
5fbab9d
[Docs] Fix headings in SIL.rst
JDevlieghere May 23, 2019
bd840d9
Merge pull request #24894 from brentdax/build-scriptable
swift-ci May 23, 2019
f5853ba
swift-api-digester: avoid adding MissingMemberDecl to the json file
nkcsgexi May 23, 2019
6ea9cd7
[Serialization] Start splitting up Decl serialization using a visitor
jrose-apple May 21, 2019
21b3766
[Serialization] Finish factoring the switch out to DeclSerializer
jrose-apple May 22, 2019
96fcfbf
[Serialization] Factor out common code for {Pre,Post}fixOperatorDecl
jrose-apple May 22, 2019
eb4b4ec
[Serialization] Push more of writeDecl into DeclSerializer
jrose-apple May 22, 2019
9471218
[Serialization] Move attribute serialization into DeclSerializer
jrose-apple May 22, 2019
0a34fe5
[Serialization] Move a bunch of helpers to DeclSerializer
jrose-apple May 22, 2019
69335f0
[diagnostics] Add the llvm option swift-diagnostics-assert-on-warning…
gottesmm May 23, 2019
6a204b7
Merge pull request #25002 from nkcsgexi/digester-missing
nkcsgexi May 23, 2019
2d22a37
Merge pull request #24986 from nkcsgexi/object-literal-syntax
nkcsgexi May 23, 2019
372046c
[diagnose-unreachable] Ignore/eliminate end_borrows after noreturn fu…
gottesmm May 23, 2019
5b2891b
Merge pull request #25006 from gottesmm/pr-66c042e5dfc5a03a389d4af3fb…
gottesmm May 23, 2019
076e0c0
Merge pull request #24994 from jckarter/SR-10264-test
jckarter May 23, 2019
9d134a8
Merge pull request #24999 from JDevlieghere/fix/sil.rst
aschwaighofer May 23, 2019
8daa034
Fix type in Inputs path
shahmishal May 23, 2019
49d25bf
[benchmark] ReportFomatter: de-tuple
palimondo May 23, 2019
a998e18
[benchmark] ReportFormatter: faster templating
palimondo May 23, 2019
b3363af
Don't use implicit dynamic on declarations if they are transparent or…
aschwaighofer May 22, 2019
b26ba2d
AST: Add utilities to ASTContext for looking up builtin initializers
slavapestov May 14, 2019
140a5b0
Sema: Build fully type-checked AST for stub initializers
slavapestov May 22, 2019
2cfc459
Sema: Build fully type-checked AST for dynamic member lookups
slavapestov May 22, 2019
95843e3
ClangImporter: Remove ConstantConvertKind::{Coerce,Downcast}
slavapestov May 22, 2019
7a630f4
ClangImporter: Track raw types of imported struct and enum wrappers
slavapestov May 22, 2019
57254cb
ClangImporter: Build type-checked AST for constants
slavapestov May 22, 2019
8075b09
ClangImporter: Set the 'throws' bit on a few CallExprs
slavapestov May 23, 2019
b82d2f2
Temporarily disable test Reflection/box_descriptors.sil on linux
aschwaighofer May 23, 2019
af7ef03
[benchmark] ReportFormatter: refactor header logic
palimondo May 23, 2019
95e90fa
[Test] Fix crash_without_backtrace_optimized.swift.
mikeash May 23, 2019
00cb21a
Merge pull request #25012 from mikeash/fix-crash-without-backtrace-op…
gottesmm May 23, 2019
9cb7ab1
Merge pull request #25007 from gottesmm/pr-d77fff3d54f2b70d825402ebfd…
gottesmm May 23, 2019
4985e0f
SILCombine: We are not guaranteed to get a function_ref instruction here
aschwaighofer May 23, 2019
476b2bb
Merge pull request #24989 from mikeash/remote-run-sftp-recursive
mikeash May 23, 2019
e80b965
Merge pull request #24996 from apple/update-parseableinterface-tests
swift-ci May 23, 2019
44e4e14
Merge pull request #25010 from aschwaighofer/implicit_dynamic_fixes
aschwaighofer May 23, 2019
b9d360c
[ConstraintSystem] NFC: Unify logic used to fix requirement failures
xedin May 23, 2019
b13bfc6
Merge pull request #25005 from jrose-apple/DeclSerializer
jrose-apple May 23, 2019
9750581
[benchmark] ReportFormatter: right-align num cols
palimondo May 23, 2019
bfc9ba9
Runtime: Don't export equalContexts.
jckarter May 23, 2019
3d4541d
Merge pull request #25009 from slavapestov/type-checked-constants
slavapestov May 23, 2019
195672a
Disable crash_without_backtrace.swift.
gottesmm May 23, 2019
dd827d3
Merge pull request #25021 from gottesmm/pr-59d7dab90a128af39312bd9372…
gottesmm May 23, 2019
84a68e1
Merge pull request #25014 from aschwaighofer/fix_combine_dynamic_func…
aschwaighofer May 23, 2019
b47215d
Merge pull request #25016 from xedin/refactor-fix-reqs
xedin May 23, 2019
73b3100
[benchmark] Fix help printing for run_smoke_bench
palimondo May 23, 2019
a2b1e34
Merge pull request #24981 from aschwaighofer/fix_assert_prev_dynamic
aschwaighofer May 23, 2019
1441ad1
Disable objc_class_resilience_stubs.swift on macOS 10.9 and 10.10
slavapestov May 23, 2019
b3f7996
[benchmark] ReportFormatter: better inline headers
palimondo May 23, 2019
fbdcd6e
[utils/build-parser-lib] Provide an option for list of architectures …
akyrtzi May 23, 2019
eff6c5a
Merge pull request #25019 from jckarter/dont-export-equalContexts
jckarter May 23, 2019
0b4309f
Merge pull request #25025 from slavapestov/disable-stubs-test-old-macos
slavapestov May 23, 2019
007d398
[Gardening] ReportFormatter: tying up loose ends
palimondo May 23, 2019
06305b2
Merge pull request #25028 from akyrtzi/utils-build-parser-flexible
swift-ci May 23, 2019
1dcb1e0
[sourcekitd] Expose the indentation option for extra indentation of s…
akyrtzi May 23, 2019
b127aac
Merge pull request #24781 from aschwaighofer/fix_some_type_dynamic_re…
aschwaighofer May 23, 2019
7b445c3
api-digester: keep track of the introduced platforms and language ver…
nkcsgexi May 24, 2019
901d947
Improve diagnostic and add fixit to correct '#else if' to 'elseif'
owenv May 23, 2019
b1b6ce6
Merge pull request #25033 from akyrtzi/sourcekitd-expose-indent-switc…
akyrtzi May 24, 2019
f89358f
[Serialization] Factor TypeSerializer out of writeType
jrose-apple May 24, 2019
f932eaf
[Serialization] Simplify metatype and function type serialization
jrose-apple May 24, 2019
dc1653f
[Serialization] Factor out a helper for types that wrap other types
jrose-apple May 24, 2019
6296a0e
[Serialization] Make sure we handle all decl kinds
jrose-apple May 24, 2019
d1a1ed1
Merge pull request #25027 from palimondo/single-table++
swift-ci May 24, 2019
6c08064
Merge pull request #25008 from owenv/improved_#else_if_diagnostic
rintaro May 24, 2019
ad67685
[cast-opt] Fix miscompile when we tried to optimize take_on_success t…
gottesmm May 24, 2019
6f42934
[test] Disable inherits_NSObject.swift on watchOS.
gottesmm May 24, 2019
94c036e
Merge pull request #25047 from gottesmm/pr-2d0d94e11406687ab9f5ab89af…
gottesmm May 24, 2019
f6ee2c7
Merge pull request #25043 from jrose-apple/TypeSerializer
jrose-apple May 24, 2019
6e0d771
Merge pull request #25039 from nkcsgexi/intro-json-file
nkcsgexi May 24, 2019
92719d6
swift-api-digester: mark if a type declaration is pulled from an exte…
nkcsgexi May 24, 2019
a1fe0f5
Merge pull request #25055 from nkcsgexi/mark-external-extensions
nkcsgexi May 25, 2019
1cede89
vim: improve syntax highlighting for `typealias`
compnerd May 25, 2019
3033a72
Merge pull request #25056 from compnerd/typealias
swift-ci May 25, 2019
381cf59
Merge pull request #24978 from linux-on-ibm-z/interleave
jckarter May 25, 2019
a042112
Merge pull request #25041 from gottesmm/pr-d02a03999626f1d50a4bf0996d…
gottesmm May 25, 2019
afcf4b6
fix documentation typo (#25061)
zntfdr May 25, 2019
a60e0e0
Add build-script -a/-A to control assertions
beccadax May 25, 2019
b088acb
Merge pull request #24767 from ikesyo/remove-unnecessary-breaks
swift-ci May 25, 2019
69674eb
vim: improve the modifier highlighting
compnerd May 25, 2019
036e74a
Merge pull request #25068 from compnerd/modifier
swift-ci May 26, 2019
c616919
Fix documentation typos.
turushan May 26, 2019
4b1bb8f
Merge pull request #25071 from turushan/typo-fix-a-array
swift-ci May 26, 2019
e0b220c
Merge pull request #25063 from brentdax/dash-a
gottesmm May 26, 2019
43d98fe
vim: improve attribute handling
compnerd May 26, 2019
1e171af
Merge pull request #25077 from compnerd/attributes
swift-ci May 26, 2019
c950082
Merging swift-DEVELOPMENT-SNAPSHOT-2019-05-26-a into tensorflow
May 28, 2019
17e8510
Update dependencies to new snapshot version 'swift-DEVELOPMENT-SNAPSH…
May 28, 2019
0b7c7bb
fix Serialization.cpp compilation after merge
May 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 48 additions & 51 deletions benchmark/scripts/compare_perf_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,15 +547,6 @@ def __init__(self, comparator, changes_only,
self.changes_only = changes_only
self.single_table = single_table

MARKDOWN_DETAIL = """
<details {3}>
<summary>{0} ({1})</summary>
{2}
</details>
"""
GIT_DETAIL = """
{0} ({1}): {2}"""

PERFORMANCE_TEST_RESULT_HEADER = ('TEST', 'MIN', 'MAX', 'MEAN', 'MAX_RSS')
RESULT_COMPARISON_HEADER = ('TEST', 'OLD', 'NEW', 'DELTA', 'RATIO')

Expand Down Expand Up @@ -589,16 +580,26 @@ def values(result):
def markdown(self):
"""Report results of benchmark comparisons in Markdown format."""
return self._formatted_text(
ROW='{0} | {1} | {2} | {3} | {4} \n',
HEADER_SEPARATOR='---',
DETAIL=self.MARKDOWN_DETAIL)
label_formatter=lambda s: ('**' + s + '**'),
COLUMN_SEPARATOR=' | ',
DELIMITER_ROW=([':---'] + ['---:'] * 4),
SEPARATOR='&nbsp; | | | | \n',
SECTION="""
<details {3}>
<summary>{0} ({1})</summary>
{2}
</details>
""")

def git(self):
"""Report results of benchmark comparisons in 'git' format."""
return self._formatted_text(
ROW='{0} {1} {2} {3} {4} \n',
HEADER_SEPARATOR=' ',
DETAIL=self.GIT_DETAIL)
label_formatter=lambda s: s.upper(),
COLUMN_SEPARATOR=' ',
DELIMITER_ROW=None,
SEPARATOR='\n',
SECTION="""
{0} ({1}): \n{2}""")

def _column_widths(self):
changed = self.comparator.decreased + self.comparator.increased
Expand All @@ -614,53 +615,49 @@ def _column_widths(self):
]

def max_widths(maximum, widths):
return tuple(map(max, zip(maximum, widths)))
return map(max, zip(maximum, widths))

return reduce(max_widths, widths, tuple([0] * 5))
return reduce(max_widths, widths, [0] * 5)

def _formatted_text(self, ROW, HEADER_SEPARATOR, DETAIL):
def _formatted_text(self, label_formatter, COLUMN_SEPARATOR,
DELIMITER_ROW, SEPARATOR, SECTION):
widths = self._column_widths()
self.header_printed = False

def justify_columns(contents):
return tuple([c.ljust(w) for w, c in zip(widths, contents)])
return [c.ljust(w) for w, c in zip(widths, contents)]

def row(contents):
return ROW.format(*justify_columns(contents))

def header(header):
return '\n' + row(header) + row(tuple([HEADER_SEPARATOR] * 5))

def format_columns(r, strong):
return (r if not strong else
r[:-1] + ('**{0}**'.format(r[-1]), ))
return ('' if not contents else
COLUMN_SEPARATOR.join(justify_columns(contents)) + '\n')

def header(title, column_labels):
labels = (column_labels if not self.single_table else
map(label_formatter, (title, ) + column_labels[1:]))
h = (('' if not self.header_printed else SEPARATOR) +
row(labels) +
(row(DELIMITER_ROW) if not self.header_printed else ''))
if self.single_table and not self.header_printed:
self.header_printed = True
return h

def format_columns(r, is_strong):
return (r if not is_strong else
r[:-1] + ('**' + r[-1] + '**', ))

def table(title, results, is_strong=False, is_open=False):
rows = [
row(format_columns(ReportFormatter.values(r), is_strong))
for r in results
]
if not rows:
if not results:
return ''

if self.single_table:
t = ''
if not self.header_printed:
t += header(ReportFormatter.header_for(results[0]))
self.header_printed = True
t += row(('**' + title + '**', '', '', '', ''))
t += ''.join(rows)
return t

return DETAIL.format(
*[
title, len(results),
(header(ReportFormatter.header_for(results[0])) +
''.join(rows)),
('open' if is_open else '')
])

return ''.join([
rows = [row(format_columns(ReportFormatter.values(r), is_strong))
for r in results]
table = (header(title if self.single_table else '',
ReportFormatter.header_for(results[0])) +
''.join(rows))
return (table if self.single_table else
SECTION.format(
title, len(results), table, 'open' if is_open else ''))

return '\n' + ''.join([
table('Regression', self.comparator.decreased, True, True),
table('Improvement', self.comparator.increased, True),
('' if self.changes_only else
Expand Down
2 changes: 1 addition & 1 deletion benchmark/scripts/run_smoke_bench
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def main():
help='In addition to stdout, write the results into a markdown file')
argparser.add_argument(
'-threshold', type=float,
help='The performance threshold in % which triggers a re-run',
help='The performance threshold in %% which triggers a re-run',
default=5)
argparser.add_argument(
'-num-samples', type=int,
Expand Down
32 changes: 31 additions & 1 deletion benchmark/scripts/test_compare_perf_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ def test_column_headers(self):
)
self.assert_markdown_contains([
'TEST | OLD | NEW | DELTA | RATIO',
'--- | --- | --- | --- | --- ',
':--- | ---: | ---: | ---: | ---: ',
'TEST | MIN | MAX | MEAN | MAX_RSS'])
self.assert_git_contains([
'TEST OLD NEW DELTA RATIO',
Expand Down Expand Up @@ -855,6 +855,36 @@ def test_report_only_changes(self):
self.assertNotIn('No Changes', html)
self.assertNotIn('AngryPhonebook', html)

def test_single_table_report(self):
"""Single table report has inline headers and no elaborate sections."""
self.tc.removed = [] # test handling empty section
rf = ReportFormatter(self.tc, changes_only=True, single_table=True)
markdown = rf.markdown()
self.assertNotIn('<details', markdown) # no sections
self.assertNotIn('\n\n', markdown) # table must not be broken
self.assertNotIn('Removed', markdown)
self.assert_report_contains([
'\n**Regression** ',
'| **OLD**', '| **NEW**', '| **DELTA**', '| **RATIO**',
'\n**Added** ',
'| **MIN**', '| **MAX**', '| **MEAN**', '| **MAX_RSS**'
], markdown)
# Single delimiter row:
self.assertIn('\n:---', markdown) # first column is left aligned
self.assertEqual(markdown.count('| ---:'), 4) # other, right aligned
# Separator before every inline header (new section):
self.assertEqual(markdown.count('&nbsp; | | | | '), 2)

git = rf.git()
self.assertNotIn('): \n', git) # no sections
self.assertNotIn('REMOVED', git)
self.assert_report_contains([
'\nREGRESSION ', ' OLD ', ' NEW ', ' DELTA ', ' RATIO ',
'\n\nADDED ', ' MIN ', ' MAX ', ' MEAN ', ' MAX_RSS '
], git)
# Separator before every inline header (new section):
self.assertEqual(git.count('\n\n'), 2)


class Test_parse_args(unittest.TestCase):
required = ['--old-file', 'old.log', '--new-file', 'new.log']
Expand Down
69 changes: 68 additions & 1 deletion docs/SIL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2337,7 +2337,7 @@ assign_by_delegate
``````````````````
::

sil-instruction ::= 'assign_by_delegate' sil-operand 'to' sil-operand ',' 'init' sil-operand ',' 'set' sil-operand
sil-instruction ::= 'assign_by_delegate' sil-operand 'to' sil-operand ',' 'init' sil-operand ',' 'set' sil-operand

assign_by_delegate %0 : $S to %1 : $*T, init %2 : $F, set %3 : $G
// $S can be a value or address type
Expand Down Expand Up @@ -3053,6 +3053,73 @@ function_ref

Creates a reference to a SIL function.

dynamic_function_ref
````````````````````
::

sil-instruction ::= 'dynamic_function_ref' sil-function-name ':' sil-type

%1 = dynamic_function_ref @function : $@convention(thin) T -> U
// $@convention(thin) T -> U must be a thin function type
// %1 has type $T -> U

Creates a reference to a `dynamically_replacable` SIL function. A
`dynamically_replacable` SIL function can be replaced at runtime.

For the following Swift code::

dynamic func test_dynamically_replaceable() {}

func test_dynamic_call() {
test_dynamically_replaceable()
}

We will generate::

sil [dynamically_replacable] @test_dynamically_replaceable : $@convention(thin) () -> () {
bb0:
%0 = tuple ()
return %0 : $()
}

sil @test_dynamic_call : $@convention(thin) () -> () {
bb0:
%0 = dynamic_function_ref @test_dynamically_replaceable : $@convention(thin) () -> ()
%1 = apply %0() : $@convention(thin) () -> ()
%2 = tuple ()
return %2 : $()
}

prev_dynamic_function_ref
`````````````````````````
::

sil-instruction ::= 'prev_dynamic_function_ref' sil-function-name ':' sil-type

%1 = prev_dynamic_function_ref @function : $@convention(thin) T -> U
// $@convention(thin) T -> U must be a thin function type
// %1 has type $T -> U

Creates a reference to a previous implemenation of a `dynamic_replacement` SIL
function.

For the following Swift code::

@_dynamicReplacement(for: test_dynamically_replaceable())
func test_replacement() {
test_dynamically_replaceable() // calls previous implementation
}

We will generate::

sil [dynamic_replacement_for "test_dynamically_replaceable"] @test_replacement : $@convention(thin) () -> () {
bb0:
%0 = prev_dynamic_function_ref @test_replacement : $@convention(thin) () -> ()
%1 = apply %0() : $@convention(thin) () -> ()
%2 = tuple ()
return %2 : $()
}

global_addr
```````````

Expand Down
16 changes: 15 additions & 1 deletion include/swift/AST/ASTContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ namespace swift {
class AvailabilityContext;
class BoundGenericType;
class ClangNode;
class ConcreteDeclRef;
class ConstructorDecl;
class Decl;
class DeclContext;
Expand Down Expand Up @@ -540,7 +541,20 @@ class ASTContext final {
bool hasArrayLiteralIntrinsics() const;

/// Retrieve the declaration of Swift.Bool.init(_builtinBooleanLiteral:)
ConstructorDecl *getBoolBuiltinInitDecl() const;
ConcreteDeclRef getBoolBuiltinInitDecl() const;

/// Retrieve the witness for init(_builtinIntegerLiteral:).
ConcreteDeclRef getIntBuiltinInitDecl(NominalTypeDecl *intDecl) const;

/// Retrieve the witness for init(_builtinFloatLiteral:).
ConcreteDeclRef getFloatBuiltinInitDecl(NominalTypeDecl *floatDecl) const;

/// Retrieve the witness for (_builtinStringLiteral:utf8CodeUnitCount:isASCII:).
ConcreteDeclRef getStringBuiltinInitDecl(NominalTypeDecl *stringDecl) const;

ConcreteDeclRef getBuiltinInitDecl(NominalTypeDecl *decl,
KnownProtocolKind builtinProtocol,
llvm::function_ref<DeclName (ASTContext &ctx)> initName) const;

/// Retrieve the declaration of Swift.==(Int, Int) -> Bool.
FuncDecl *getEqualIntDecl() const;
Expand Down
6 changes: 6 additions & 0 deletions include/swift/AST/DiagnosticsParse.def
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ ERROR(extra_tokens_conditional_compilation_directive,none,
"extra tokens following conditional compilation directive", ())
ERROR(unexpected_rbrace_in_conditional_compilation_block,none,
"unexpected '}' in conditional compilation block", ())
ERROR(unexpected_if_following_else_compilation_directive,none,
"unexpected 'if' keyword following '#else' conditional compilation "
"directive; did you mean '#elseif'?",
())

ERROR(pound_diagnostic_expected_string,none,
"expected string literal in %select{#warning|#error}0 directive",(bool))
Expand Down Expand Up @@ -734,6 +738,8 @@ ERROR(expected_type_after_arrow,none,
ERROR(function_type_argument_label,none,
"function types cannot have argument labels; use '_' before %0",
(Identifier))
ERROR(expected_dynamic_func_attr,none,
"expected a dynamically_replaceable function", ())

// Enum Types
ERROR(expected_expr_enum_case_raw_value,PointsToFirstBadToken,
Expand Down
8 changes: 0 additions & 8 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -4114,17 +4114,9 @@ ERROR(borrowed_on_objc_protocol_requirement,none,
// MARK: dynamic
//------------------------------------------------------------------------------

ERROR(dynamic_not_in_class,none,
"only members of classes may be dynamic", ())
ERROR(dynamic_with_nonobjc,none,
"a declaration cannot be both '@nonobjc' and 'dynamic'",
())
ERROR(dynamic_with_transparent,none,
"a declaration cannot be both '@_tranparent' and 'dynamic'",
())
ERROR(dynamic_requires_objc,none,
"'dynamic' %0 %1 must also be '@objc'",
(DescriptiveDeclKind, DeclName))

//------------------------------------------------------------------------------
// MARK: @_dynamicReplacement(for:)
Expand Down
19 changes: 17 additions & 2 deletions include/swift/AST/Expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -955,15 +955,25 @@ class TapExpr : public Expr {
class InterpolatedStringLiteralExpr : public LiteralExpr {
/// Points at the beginning quote.
SourceLoc Loc;
/// Points at the ending quote.
/// Needed for the upcoming \c ASTScope subsystem because lookups can be
/// targeted to inside an \c InterpolatedStringLiteralExpr. It would be nicer
/// to use \c EndLoc for this value, but then \c Lexer::getLocForEndOfToken()
/// would not work for \c stringLiteral->getEndLoc().
SourceLoc TrailingQuoteLoc;
TapExpr *AppendingExpr;
Expr *SemanticExpr;

public:
InterpolatedStringLiteralExpr(SourceLoc Loc, unsigned LiteralCapacity,
InterpolatedStringLiteralExpr(SourceLoc Loc,
SourceLoc TrailingQuoteLoc,
unsigned LiteralCapacity,
unsigned InterpolationCount,
TapExpr *AppendingExpr)
: LiteralExpr(ExprKind::InterpolatedStringLiteral, /*Implicit=*/false),
Loc(Loc), AppendingExpr(AppendingExpr), SemanticExpr() {
Loc(Loc),
TrailingQuoteLoc(TrailingQuoteLoc),
AppendingExpr(AppendingExpr), SemanticExpr() {
Bits.InterpolatedStringLiteralExpr.InterpolationCount = InterpolationCount;
Bits.InterpolatedStringLiteralExpr.LiteralCapacity = LiteralCapacity;
}
Expand Down Expand Up @@ -1000,6 +1010,11 @@ class InterpolatedStringLiteralExpr : public LiteralExpr {
// token, so the range should be (Start == End).
return Loc;
}
SourceLoc getTrailingQuoteLoc() const {
// Except when computing a SourceRange for an ASTScope. Then the range
// must be (Start - TrainingQuoteLoc).
return TrailingQuoteLoc;
}

/// Call the \c callback with information about each segment in turn.
void forEachSegment(ASTContext &Ctx,
Expand Down
1 change: 1 addition & 0 deletions include/swift/AST/KnownStdlibTypes.def
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ KNOWN_STDLIB_TYPE_DECL(Float80, NominalTypeDecl, 0)
KNOWN_STDLIB_TYPE_DECL(_MaxBuiltinFloatType, TypeAliasDecl, 0)

KNOWN_STDLIB_TYPE_DECL(String, NominalTypeDecl, 0)
KNOWN_STDLIB_TYPE_DECL(StaticString, NominalTypeDecl, 0)
KNOWN_STDLIB_TYPE_DECL(Substring, NominalTypeDecl, 0)
KNOWN_STDLIB_TYPE_DECL(Array, NominalTypeDecl, 1)
KNOWN_STDLIB_TYPE_DECL(Set, NominalTypeDecl, 1)
Expand Down
Loading