Commit Graph

62638 Commits

Author SHA1 Message Date
Kuba Mracek
0b7bb605cb Don't hardcode the function representation of builtin "once". Make emitLazyGlobalInitializer retrieve the convention from getBuiltinValueDecl. 2018-01-03 10:30:24 -08:00
Andrew Trick
17fa484f04 SILGen. Fix temporary LValue cleanup.
Use the LValue formal evaluation scope to destroy temporary lvalues that aren't
part of the expression's resulting value.

Disable an old hack that destroyed call site arguments after the call.

This is the first step in cleanup up LValue materialization.
2018-01-01 19:05:22 -08:00
swift-ci
73bf2dfab3 Merge pull request #13656 from lattner/iOSSimFix 2018-01-01 13:36:23 -08:00
swift-ci
b3bcece73f Merge pull request #13661 from davezarzycki/nfc_avoid_getCanonicalType_reg_spills 2018-01-01 12:14:43 -08:00
David Zarzycki
47328a5054 [AST] Perf: Avoid reg spills on the fast path of getCanonicalType() 2018-01-01 11:38:04 -05:00
Chris Lattner
3761ee3f1b Remove a transformation introduced in PR13652 which fails on the iOS
simulator in a way I can't repro.  Reimplement the important part of it
in a new way to achieve the same effect.
2018-01-01 07:45:54 -08:00
Doug Gregor
b11d5447c6 Merge pull request #13643 from DougGregor/redecl-fewer-validations
[Type checker] Make redeclaration checking validate fewer declarations.
2017-12-31 20:20:53 -08:00
Chris Lattner
1e63108998 Speculative fix for a regression on the
"oss-swift_tools-RA_stdlib-RD_test-simulator" iOS simulator bot.
2017-12-31 20:13:58 -08:00
Doug Gregor
8b58b0dbb4 [Type checker] Make redeclaration checking validate fewer declarations.
Redeclaration checking was validating all declarations with the same
base name as the given declaration (and in the same general nominal
type), even when it was trivial to determine that the declarations
could not be conflicting. Separate out the easy structural checks
(based on kind, full name, instance vs. non-instance member, etc.) and
perform those first, before validation.

Fixes SR-6558, a case where redeclaration checking caused some
unnecessary recursion in the type checker.
2017-12-30 23:27:04 -08:00
Chris Lattner
de289752fe Implement a few silcombine transformations for arrays (#13652)
* Implement a few silcombine transformations for arrays

 - Useless existential_ref <-> class conversions.
 - mark_dependence_inst depending on uninteresting instructions.
 - release(init_existential_ref(x)) -> release(x) when hasOneUse(x)
 - Update COWArrayOpt to handle the new forms generated by this.

these aren't massive performance wins, but do shrink the size of SIL when
dealing with arrays.

* Generalize testcase to work on linux and on mac when checking stdlib is enabled.
2017-12-30 22:30:37 -08:00
swift-ci
b236feb02d Merge pull request #13651 from gottesmm/pr-5364f9a2a30094124ca247b9ae0f7dea35d58eb7 2017-12-30 20:26:52 -08:00
Michael Gottesman
8c0908aac5 [cmake][build-script] Add support for building the runtime with +0 normal args.
I am upstreaming some changes to the runtime to support +0 normal arguments.

rdar://34222540
2017-12-30 21:58:25 -05:00
swift-ci
dd4e71dcac Merge pull request #13650 from gottesmm/pr-f8a5f14f05eebc3cb838bd7e05b0cfc88a94025a 2017-12-30 16:15:08 -08:00
Michael Gottesman
5f5ed55741 [silgen] When emitting a curry thunk, if the canonical type of the function differs from the actual function type in a non-ABI compatible way, use a canonical function thunk instead of a convert_function.
convert_function can only be used for to convert in between ABI compatible
functions.

rdar://34222540
2017-12-30 18:41:37 -05:00
Michael Gottesman
b78f350c05 [+0-all] Teach silopt about normal guaranteed parameters so that it assumes that all modules have that flag enabled.
rdar://34222540
2017-12-30 17:22:08 -05:00
swift-ci
af56e8401b Merge pull request #13646 from davezarzycki/nfc_more_typerepr_trailing_objects 2017-12-30 11:19:39 -08:00
David Zarzycki
55904846b1 [AST] NFC: Migrate CompositionTypeRepr to llvm::TrailingObjects 2017-12-30 11:23:22 -05:00
David Zarzycki
00d35aba43 [AST] NFC: Fix TypeReprNodes.def indentation error 2017-12-30 11:02:38 -05:00
David Zarzycki
408bf0d840 [AST] NFC: Migrate CompoundIdentTypeRepr to llvm::TrailingObjects 2017-12-30 10:56:37 -05:00
David Zarzycki
9c33f05f97 [AST] NFC: Migrate GenericIdentTypeRepr to llvm::TrailingObjects 2017-12-30 10:12:26 -05:00
David Zarzycki
5e0d60fe34 [AST] NFC: Micro-optimize TupleTypeRepr misc bits
TupleTypeRepr has "misc bits" to spare and x86 has a small bias against
8/16-bit logic (due to partial register updates, instruction length
modifying prefixes, etc.)
2017-12-30 09:47:39 -05:00
swift-ci
d726bd85a2 Merge pull request #13645 from davezarzycki/nfc_hasParenSugar swift-DEVELOPMENT-SNAPSHOT-2017-12-30-a 2017-12-29 11:12:41 -08:00
Harlan
9185ef5610 [Syntax] Add #selector and #keyPath tokens (#13615)
* [Syntax] Add #selector and #keyPath tokens

* [Syntax][test] Add #selector and #keyPath to syntax parsing tests

* [Syntax] Don't fatalError on an unknown token kind

* Fix test build error
2017-12-29 12:35:08 -05:00
David Zarzycki
62795501d9 [AST] NFC: De-boilerplate "has ParenType sugar" 2017-12-29 11:37:20 -05:00
swift-ci
0a41588dc3 Merge pull request #13644 from davezarzycki/nfc_hasParenSema swift-DEVELOPMENT-SNAPSHOT-2017-12-29-a 2017-12-29 08:23:23 -08:00
David Zarzycki
41a0553228 [AST] NFC: De-boilerplate TupleType "is paren like" checks
Also, make callers be explicit when they're ignoring the field name.
2017-12-29 08:32:28 -05:00
Rintaro Ishizaki
01f42c89d3 Merge pull request #13631 from omochi/lex-escape-backtick
[Parse] Lexer build backtick trivia around espaced identifier token
2017-12-29 12:36:00 +09:00
swift-ci
cfe6e0c847 Merge pull request #13640 from davezarzycki/nfc_repack_two_pattern_bits 2017-12-28 13:31:32 -08:00
Davide Italiano
3e3ca91aa1 Merge pull request #13638 from dcci/syntax-statement
[lib/Syntax] Rename another API, statments -> statements.
2017-12-28 20:40:45 +01:00
Davide Italiano
da5fb99742 Merge pull request #13639 from dcci/silunused
[SIL] Remove dead store and placate -Wunused. NFCI.
2017-12-28 20:40:26 +01:00
David Zarzycki
296d1b8195 [AST] NFC: Repack two Pattern bits 2017-12-28 14:20:21 -05:00
swift-ci
d2dc653420 Merge pull request #13637 from davezarzycki/sil_nfc_remove_boilerplate3 2017-12-28 08:46:48 -08:00
Yurii Samsoniuk
d5771cea6b Added extension specialization to libSyntax 2017-12-29 01:27:26 +09:00
swift-ci
aed31936ac Merge pull request #13635 from davezarzycki/basic_nfc_inline_bitfield_cleanup 2017-12-28 08:19:20 -08:00
Davide Italiano
97336c504d [SIL] Remove dead store and placate -Wunused. NFCI. 2017-12-28 08:02:00 -08:00
Davide Italiano
7e5682614a [lib/Syntax] Rename another API, statments -> statements. 2017-12-28 07:58:13 -08:00
omochimetaru
bc88330740 [Parse] Lexer build backtick trivia around espaced identifier token 2017-12-29 00:22:49 +09:00
omochimetaru
36adae8ce8 [Syntax] add test for escaped identifier 2017-12-29 00:22:38 +09: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
Rintaro Ishizaki
33164cce01 Merge pull request #13625 from rintaro/syntax-cleanup
[Syntax] Fix miscellaneous round trip failures
swift-DEVELOPMENT-SNAPSHOT-2017-12-28-a
2017-12-28 16:49:50 +09:00
Rintaro Ishizaki
f0b10427e3 Merge pull request #13626 from omochi/syntax-bom
[Syntax] add UTF-8 BOM support to libSyntax
2017-12-28 12:23:54 +09:00
swift-ci
4d83e8c15a Merge pull request #13628 from davezarzycki/sil_nfc_remove_TailAllocatedOperandList swift-DEVELOPMENT-SNAPSHOT-2017-12-27-a 2017-12-27 10:40:11 -08:00
omochimetaru
ebd5323b42 [Syntax] add UTF-8 BOM support to libSyntax 2017-12-28 01:26:09 +09:00
David Zarzycki
3910c0d211 [SIL] NFC: Remove TailAllocatedOperandList template
Please use InstructionBaseWithTrailingOperands template now. It is more type safe and more space efficient.
2017-12-27 11:18:54 -05:00
David Zarzycki
679538b72c [SIL] NFC: Migrate SelectInstBase subclasses to InstructionBaseWithTrailingOperands 2017-12-27 11:14:17 -05:00
Davide Italiano
72ee07b8d5 [lib/Syntax] Rename an API, accesor->accessor.
The latter is the correct way.
2017-12-28 00:54:45 +09:00
David Zarzycki
d532fdefe0 [SIL] NFC: Migrate AllocRefInstBase subclasses to InstructionBaseWithTrailingOperands 2017-12-27 08:00:20 -05:00
omochimetaru
c8a6ef13da [Parse] add test about BOM + trivia 2017-12-27 18:06:18 +09:00
Rintaro Ishizaki
002cfe5136 [Syntax] Add test cases for fixed round trip failures. 2017-12-27 17:49:33 +09:00