Commit Graph

18 Commits

Author SHA1 Message Date
Erik Eckstein
7cceaff5f3 SIL: don't print operand types in textual SIL
Type annotations for instruction operands are omitted, e.g.

```
  %3 = struct $S(%1, %2)
```

Operand types are redundant anyway and were only used for sanity checking in the SIL parser.

But: operand types _are_ printed if the definition of the operand value was not printed yet.
This happens:

* if the block with the definition appears after the block where the operand's instruction is located

* if a block or instruction is printed in isolation, e.g. in a debugger

The old behavior can be restored with `-Xllvm -sil-print-types`.
This option is added to many existing test files which check for operand types in their check-lines.
2024-11-21 18:49:52 +01:00
Nate Chandler
9bb0187be1 [SILGen] Add begin_borrow [var_decl] lifetimes. 2023-11-28 07:26:09 -08:00
Nate Chandler
6bb18263d1 [Test] Adjusted SIL tests.
Now that
- owned arguments don't get lexical borrow scopes from SILGen
- owned arguments get lexical moves during inlining unless the value
  passed for that argument is already lexical
- guaranteed arguments don't get lexical borrow scopes during inlining
  when the value passed for that argument is already lexical
tests involving owned argument emission from SILGen and inlining need to
be updated.
2023-01-25 11:36:33 -08:00
Josh Soref
9a6bf46c0f Spelling silgen
* actually
* arbitrary
* cargo-culted
* clazz
* constrained
* continuation
* coordinator
* coroutine
* derivative
* destroyer
* given
* have
* imported
* initialization
* items
* necessarily
* occurring
* omitting
* overridden
* parameter
* possible
* predecessor
* preparation
* resilience
* should
* struct
* that
* the
* throwing
* unexpectedly
* uniqueness
* using
* value
* villain

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-11-09 21:44:17 -05:00
Slava Pestov
a754bb1452 Revert "Revert "Merge pull request #59293 from slavapestov/objc-thunk-linkage""
This reverts commit 2007d6549b.
2022-06-08 03:01:38 -04:00
Alex Hoppen
2007d6549b Revert "Merge pull request #59293 from slavapestov/objc-thunk-linkage"
This reverts commit 831be7f5e0, reversing
changes made to 8b77860a1e.
2022-06-08 08:23:45 +02:00
Slava Pestov
27787e0721 SIL: @objc thunks should have private SIL linkage
Previously we gave them the same SIL linkage as the method, then changed
the LLVM IR linkage to 'internal' (which is roughly equivalent to
SIL 'private') in IRGen.

This would crash in the SIL verifier if an @objc method was
'@_alwaysEmitIntoClient'. While such a combination of attributes is
silly since '@objc' methods are intrinsically part of the ABI, we
should not crash in this case.

The simplest fix is to just set the linkage to private at the SIL
level, avoiding the IRGen hack entirely.
2022-06-07 01:10:35 -04:00
Nate Chandler
cf08f8878d [Test] Adapted SILGen tests. 2022-01-13 13:33:42 -08:00
Michael Gottesman
785153045b [move-operator] Start having SILGen emit lexical lifetimes and teach the optimizer how to maintain lexical lifetimes until the lexical lifetime elimination.
I am doing this so that I can use lexical lifetimes to emit diagnostics such as
the move operator diagnostics.
2021-11-29 18:02:13 -08:00
Becca Royal-Gordon
39115425b7 Rephrase all access note remarks
• There is now one access note success remark and fix-it per declaration, not per attribute/modifier.
• Failure remarks have been rephrased to better emphasize the cause of the failure.
• The wording of other access note remarks and notes have been changed to follow a similar formula.
2021-05-22 13:01:29 -07:00
Becca Royal-Gordon
79eaf77218 Weaken access note warnings into remarks 2021-02-09 14:17:35 -08:00
Becca Royal-Gordon
d347ffae0e Correct access notes flag spelling and add to driver 2021-02-09 14:17:34 -08:00
Becca Royal-Gordon
4743d9f3e1 Diagnose @objc(selector) access note conflicts 2021-02-09 14:17:34 -08:00
Becca Royal-Gordon
feca4e6391 Let access notes apply to accessors
`Name: ‘getter:Context.property()’` now applies an access note to a getter of Context.property, and `Name: ‘setter:Context.property(_:)’` applies one to its setter. Additionally, access notes without `getter:` or `setter:` now cannot apply to accessors.
2021-02-09 14:17:34 -08:00
Becca Royal-Gordon
9ca2fbdb74 Clarify behavior of access note with ObjCName only
An access note with an ObjCName property but no ObjC property now implicitly sets ObjC to true. ObjC: false with an ObjCName is still illegal.
2021-02-09 14:17:34 -08:00
Brent Royal-Gordon
f99bfbadef Warn about modifications made by access notes 2021-02-09 14:17:34 -08:00
Brent Royal-Gordon
fafbb89118 Apply access notes 2021-02-09 14:17:33 -08:00
Becca Royal-Gordon
ccf244b89b Add ability to load access notes 2021-02-09 14:17:33 -08:00