GCC `-fpermissive` flagged this annotation as being discarded as it is
being applied after the definition. Move the annotation to the
re-definition to which it appertains.
This adds the initial conditional compilation support for the WASM32
"architecture" assuming that WASI is used as the "OS". Support for
baremetal targets in Swift needs more work still, but this gives enough
infrastructure to start playing with WASM.
Switch over `Triple::getOS` instead of a series of cascading `if`s.
This simplifies the handling of adding new entries. It also makes the
precedence ordering more explicit.
Frontend outputs source-as-compiled, and source-ranges file with function body ranges and ranges that were unparsed in secondaries.
Driver computes diffs for each source file. If diffs are in function bodies, only recompiles that one file. Else if diffs are in what another file did not parse, then the other file need not be rebuilt.
By convention, most structs and classes in the Swift compiler include a `dump()` method which prints debugging information. This method is meant to be called only from the debugger, but this means they’re often unused and may be eliminated from optimized binaries. On the other hand, some parts of the compiler call `dump()` methods directly despite them being intended as a pure debugging aid. clang supports attributes which can be used to avoid these problems, but they’re used very inconsistently across the compiler.
This commit adds `SWIFT_DEBUG_DUMP` and `SWIFT_DEBUG_DUMPER(<name>(<params>))` macros to declare `dump()` methods with the appropriate set of attributes and adopts this macro throughout the frontend. It does not pervasively adopt this macro in SILGen, SILOptimizer, or IRGen; these components use `dump()` methods in a different way where they’re frequently called from debugging code. Nor does it adopt it in runtime components like swiftRuntime and swiftReflection, because I’m a bit worried about size.
Despite the large number of files and lines affected, this change is NFC.
Turns out self-type-stripping /always/ operates on a type without
prefixes rather than /never/. Neither of these behaviors are really
what we'd want, but we'll live with it!
rdar://problem/56334797
Yeah, SmallVectorImpl<char> is less convenient to work with, but
that's no reason to write out a stack buffer and then do a copy.
No functionality change.
All of the remaining name-matching logic is case-insensitive, and
the resulting name will have a stronger form of lowercasing applied
anyway, so we can leave the name with a leading uppercase letter in
its intermediate state. Slightly less pure, but also slightly less
code and slightly less memory use.
Method base names are where the most complicated logic is, so let's
split it out from the other cases a bit. Also makes early returns more
explicit.
No intended functionality change.
SourceManager may outlive ASTContext where external source file paths are managed.
Therefore, we should use the identifier from the memory buffer as the key instead of
using a pointer from an ASTContext.
When Decl::getLoc() is called upon a serialized AST and the
serialized source location is available, we lazily open the
external buffer and return a valid SourceLoc instance pointing
into the buffer.
Previously this was /also/ called 'omitNeedlessWords'. Rename it to
avoid confusion and better describe the particular step it's taking.
I don't love the "with special cases" but I think it's important to
note that this isn't an exact parallel of matchLeadingTypeName.
This is the only omission kind that needs to look in the middle of a
name rather than just at the start or the end. So, handle that
explicitly instead to simplify all the other code.
Separate the functional searching bit from the actual "omitting" bit
once the type name is matched. This in turn provides a good place to
flip from reverse iterators back to forward iterators, making the
following code about omitting a fair bit clearer.
No functionality change. This is 90% moving things around and 10%
rephrasing.