Previously we would only enable by default when
`parseArgs` was called. However this wouldn't
enable it for clients such as LLDB, who provide
their own invocation. Switch the default to `true`
in the `LangOptions`, and remove some redundant
uses of `-enable-experimental-string-processing`.
The frontend flag remains, as it may be useful to
disable.
rdar://107419385
rdar://101765556
The `__future__` we relied on is now, where the 3 specific things are
all included [since Python 3.0](https://docs.python.org/3/library/__future__.html):
* absolute_import
* print_function
* unicode_literals
* division
These import statements are no-ops and are no longer necessary.
In Python 3, subprocess output is read as binary data by default, which isn’t what we want.
Instead of reading process output as byte strings, then manually decoding them into strings, simply pass `text=True` to functions in the `subprocess` module, so that we get properly decoded strings right out the box.
This fixes places that forget to do the decoding step — most especially, the `update-checkout` script. That script prints Git output as byte strings, which leads to unreadable results.
Additionally, in shell.run, use the same pipe for capturing both stdout and stderr. The distinction is pretty pointless in this use case; however, keeping the two channels separate means that we lose the original ordering of printed messages, which does matter.
These modules are part of the experimental declarative string processing feature. If accepted to the Standard Library, _StringProcessing will be available via implicit import just like _Concurrency, though _MatchingEngine will still be hidden as an implementation detail.
`_MatchingEngine` will contain the general-purpose pattern matching engine ISA, bytecode, and executor. `_StringProcessing` will contain regular expression and pattern matching APIs whose implementation depends on the matching engine..
Also consolidates frontend flag `-enable-experimental-regex` as `-enable-experimental-string-processing`.
Resolves rdar://85478647.
`ClangFileRewriterHelper` only outputs the rewritten buffer when it's
destroyed, but the consumers were never being freed. Cleanup the
lifetime management of the stream and consumers so that they're properly
destroyed.
Rename `DuplicatingSourceEditConsumer` to
`BroadcastingSourceEditConsumer` to better describe its purpose.
When adding an async alternative, add the @completionHandlerAsync
attribute to the sync function. Check for this attribute in addition to
the name check, ie. convert a call if the callee has either
@completionHandlerAsync or a name that is completion-handler-like name.
The addition of the attribute is currently gated behind the experimental
concurrency flag.
Resolves rdar://77486504
Instead of leaving two copies of the same implementation, rewrite the old method with the completion handler to call the newly added `async` method.
Resolves rdar://74464833