* Fix unnecessary one-time recompile of stdlib with -enable-ossa-flag
This includes a bit in the module format to represent if the module was
compiled with -enable-ossa-modules flag. When compiling a client module
with -enable-ossa-modules flag, all dependent modules are checked for this bit,
if not on, recompilation is triggered with -enable-ossa-modules.
* Updated tests
Clang and Swift both support this so we can do this until the actual fix lands
in a host toolchain to unblock ErikE.
The specific problem is the swift driver should just push tbd files through to
the linker, but it treats it as an input file. I am going to be putting a fix
into 5.5. This patch in the mean time filters out the tbd files in cmake. This
is a temporary fix.
I also had to add direct dependencies from swift-refactor and
libSwiftSyntaxParser on LLVMSupport to ensure that the right linker flags get to
them.
Previously, we were always accessing the `DeferredTokenNode`’s `Range`, which is not valid if the token is missing, thus causing an assertion failure when asked for its length.
Fixes rdar://77391988 [SR-14552]
We have finally reached our goal of optimising deferred node creation
for SyntaxTreeCreator. Instead of creating dedicated deferred nodes and
copying the data into a RawSyntax node when recording, we always create
RawSyntax nodes. Recording a deferred node is thus a no-op, since we
have already created a RawSyntax node. Should a deferred node not be
recorded, it stays alive in the SyntaxArena without any reference to it.
While this means, we are leaking some memory for such nodes, most nodes
do get recorded, so the overhead should be fine compared to the
performance benefit.
By now ParsedRawSyntaxNode does not have any knowledge about deferred
node data anymore, which frees up SyntaxParseActions (and, in
particular its sublass SyntaxTreeCreator) to perform optimisations to
more efficiently create and record deferred nodes.
We don't actually need the range for layout nodes, so just store it
for token nodes. This will also make deferred node handling easier
later on, because we don't need to keep track of layout node ranges.
Previously, the passed in source file was implicitly terminated by the
first null character. The source file might, however, contain a null
character in the middle and we shouldn't stop parsing at it.
It was originally designed for faster trasmission of syntax trees from
C++ to SwiftSyntax, but superceded by the CLibParseActions. There's no
deserializer for it anymore, so let's just remove it.
Use the `TARGETS` form of `install` to avoid having to spell out the
location and file name to install. Additionally, setup the installation
rules to work better for Windows by listing install locations for the
archive (static library) form (which includes the import library on
Windows), library form (which is the Unix library), and the runtime
component (the .dll on Windows).
Currently when parsing a SourceFile, the parser
gets handed pointers so that it can write the
interface hash and collected tokens directly into
the file. It can also call `setSyntaxRoot` at
the end of parsing to set the syntax tree.
In preparation for the removal of
`performParseOnly`, this commit formalizes these
values as outputs of `ParseSourceFileRequest`,
ensuring that the file gets parsed when the
interface hash, collected tokens, or syntax tree
is queried.
Remove the `EvaluateConditionals` flags from the
parser, and instead query the source file.
This commit also changes ParserUnit such that it
doesn't evaluate #if conditions by default, as
none of its clients appear to require it. The
only client that wasn't explicitly disabling #if
evaluation and is processing the resulting AST is
swift-indent, so this commit also adds a test to
ensure it continues to work correctly with #if
decls.
Restore the previous commit which somehow passed the buildbot given a
missing condition on the sub-configure for libdispatch. This makes it
more explicit as to what the desire is; the variable was being used to
serve as a proxy for whether the build is not on a Darwin target.
This flag was being used as an alias for whether or not the host is
non-Darwin. Rather than adding custom checks for this, use the explicit
check that CMake supports. This simplifies the logic and avoids the
proliferation of custom variables which can become confusing for others
who are not familiar with the custom build infrastructure.
When building in a unified build and building the host tools with a
non-clang compiler, we switch compilers. In such a case, we need to
actually add an explicit dependency on the new compiler.
Rather than use explicit permissions, use `install(PROGRAMS` to achieve
the same permission set. It is unclear why the library is installed as
a program, but maintain the current permissions.
This commit introduces a CMake target for each component, adds install targets
for them, and switches build-script-impl to use the target `install-components`
for installation. Each of the targets for each component depends on each
of the individual targets and outputs that are associated with the
corresponding swift-component.
This is equivalent to what already exists, because right now install rules are
only generated for components that we want to install. Therefore, this commit
should be an NFC.
This is a resubmission (with modifications) of an earlier change. I originally
committed this but there were problems with some installation rules.
Now that we've moved to C++14, we no longer need the llvm::make_unique
implementation from STLExtras.h. This patch is a mechanical replacement
of (hopefully) all the llvm::make_unique instances in the swift repo.
This commit introduces a CMake target for each component, adds install targets
for them, and switches build-script-impl to use the target `install-components`
for installation. Each of the targets for each component depends on each
of the individual targets and outputs that are associated with the
corresponding swift-component.
This is equivalent to what already exists, because right now install rules are
only generated for components that we want to install. Therefore, this commit
should be an NFC.