Commit Graph

6 Commits

Author SHA1 Message Date
Becca Royal-Gordon
da07ff577c [PrintAsClang] Warn about unstable decl order
PrintAsClang is supposed to emit declarations in the same order regardless of the compiler’s internal state, but we have repeatedly found that our current criteria are inadequate, resulting in non-functionality-affecting changes to generated header content. Add a diagnostic that’s emitted when this happens soliciting a bug report.

Since there *should* be no cases where the compiler fails to order declarations, this diagnostic is never actually emitted. Instead, we test this change by enabling `-verify` on nearly all PrintAsClang tests to make sure they are unaffected.

This did demonstrate a missing criterion that only mattered in C++ mode: extensions that varied only in their generic signature were not sorted stably. Add a sort criterion for this.
2025-02-14 21:41:36 -08:00
Dmitri Gribenko
486cab447d tests: replace 'rm -rf %t && mkdir -p %t' with '%empty-directory(%t)'
These changes were made using a script.
2017-06-04 11:08:39 -07:00
David Farler
b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00
Dmitri Gribenko
55864d10cb Tests: use 'mkdir -p' 2016-09-02 21:36:45 -07:00
Jordan Rose
20bfc1eaa2 [Serialization] If the output swiftmodule hasn't changed, don't touch the previous one.
Compiler output at least up to serialization should be deterministic at this point,
at least when not taking SIL into account. This /should/ mean that changing a
function body should not affect the final built swiftmodule, which means downstream
targets don't need to be rebuilt. Leaving the previous swiftmodule output in place
signals that.

A while back I put in a push to get all the non-determinism out of type checking,
importing, and serialization itself; it looks like we've finally made it. Let's keep
it that way!

rdar://problem/20539158 and others

Swift SVN r29923
2015-07-06 23:26:01 +00:00
Jordan Rose
95856c05fb If the generated header doesn't change, don't touch the original file.
Mixed-source targets generally include the generated <Product>-Swift.h
header in many Objective-C (.m) source files. Any change to a Swift file
results in the header being touched, which means all the .m files get
recompiled.

This change makes Swift write the generated header to a temporary file
first, then use the previous commit's moveFileIfDifferent to put it in
its final destination.

rdar://problem/20553459

Swift SVN r28042
2015-05-01 17:40:31 +00:00