Any valid name beginning with `#` that isn't already a preprocessor
macro is now considered a freestanding macro. Previously, only
preprocessor macros were handled in the vim syntax file, e.g. `#if`.
For example, this properly handles the syntax for the `#expect` and the
`#require` macros used in Swift Testing.
The problem with `is_escaping_closure` was that it didn't consume its operand and therefore reference count checks were unreliable.
For example, copy-propagation could break it.
As this instruction was always used together with an immediately following `destroy_value` of the closure, it makes sense to combine both into a `destroy_not_escaped_closure`.
It
1. checks the reference count and returns true if it is 1
2. consumes and destroys the operand
Introduce a new instruction `dealloc_stack_ref ` and remove the `stack` flag from `dealloc_ref`.
The `dealloc_ref [stack]` was confusing, because all it does is to mark the deallocation of the stack space for a stack promoted object.
This change is motivated by highlighting for
test/Interpreter/SDK/lib.swift. It contains the line
// CHECK: the magic word is ///* magic *///
which without this change leaves the rest of the file highlighted as
commented out. swiftComment cannot contain swiftLineComment, or else
this:
/* // */ hello
gets incorrectly highlighted as if "hello" was commented out.
Similarly, swiftLineComment cannot contain swiftComment, or else this:
// /*
*/
gets incorrectly highlighted as if */ was closing a comment, when
actually it should be a syntax error.
This improves the detection of syntax so that the identifier for a
typealias is identified as an identifier, the `=` is identified as a
delimiter, and the type that is aliased is identified as a type.
Will be used to verify that withoutActuallyEscaping's block does not
escape the closure.
``%escaping = is_escaping_closure %closure`` tests the reference count. If the
closure is not uniquely referenced it prints out and error message and
returns true. Otherwise, it returns false. The returned result can be
used with a ``cond_fail %escaping`` instruction to abort the program.
rdar://35525730
* Implement #warning and #error
* Fix #warning/#error in switch statements
* Fix AST printing for #warning/#error
* Add to test case
* Add extra handling to ParseDeclPoundDiagnostic
* fix dumping
* Consume the right paren even in the failure case
* Diagnose extra tokens on the same line after a diagnostic directive
* vim-syntax: fix highlighting for indirect case/enum
without skipwhite, `indirect enum` never gets highlighted. this
commit also adds the `indirect case` multiword keyword.
* vim-syntax: allow whitespace before type parameters
Added skipwhite to multiple match groups so that whitespace can be used
before type parameters (`Type <Param>`). This matches Xcode's behavior.
* vim-syntax: update last change line
* vim-syntax: remove indirect case from multiword type def group
* vim-syntax: highlight #function preproc macro
* vim-syntax: highlight preproc macros in string interpolation
* vim syntax: make string interpolation a matchgroup
Now, only the opening \( and ) are highlighted, and everything inside retains its coloring
This has the same semantics as open_existential_box, but returns an object value
instead of an address.
This is used in SIL opaque values mode. Attempting to reuse open_existential_box
in this mode causes SIL type inconsistencies that are too difficult to work
around. Adding this instruction allows for consistent handling of opaque values.
The original versions of several of these currently redundant instructions will
be removed once the SIL representation stabilizes.
These instructions have the same semantics as the *ExistentialAddr instructions
but operate directly on the existential value, not its address.
This is in preparation for adding ExistentialBoxValue instructions.
The previous name would cause impossible confusion with "opaque existentials"
and "opaque existential boxes".