23 Commits

Author SHA1 Message Date
Tim Kientzle
1d961ba22d Add #include "swift/Basic/Assertions.h" to a lot of source files
Although I don't plan to bring over new assertions wholesale
into the current qualification branch, it's entirely possible
that various minor changes in main will use the new assertions;
having this basic support in the release branch will simplify that.
(This is why I'm adding the includes as a separate pass from
rewriting the individual assertions)
2024-06-05 19:37:30 -07:00
Ben Barham
ef8825bfe6 Migrate llvm::Optional to std::optional
LLVM has removed llvm::Optional, move over to std::optional. Also
clang-format to fix up all the renamed #includes.
2024-02-21 11:20:06 -08:00
Rick van Voorden
f8ae46b3f3 [inclusive-language] changed sanity to soundness 2024-01-25 18:18:02 -08:00
Evan Wilde
250082df25 [NFC] Reformat all the LLVMs
Reformatting everything now that we have `llvm` namespaces. I've
separated this from the main commit to help manage merge-conflicts and
for making it a bit easier to read the mega-patch.
2023-06-27 09:03:52 -07:00
Evan Wilde
f3ff561c6f [NFC] add llvm namespace to Optional and None
This is phase-1 of switching from llvm::Optional to std::optional in the
next rebranch. llvm::Optional was removed from upstream LLVM, so we need
to migrate off rather soon. On Darwin, std::optional, and llvm::Optional
have the same layout, so we don't need to be as concerned about ABI
beyond the name mangling. `llvm::Optional` is only returned from one
function in
```
getStandardTypeSubst(StringRef TypeName,
                     bool allowConcurrencyManglings);
```
It's the return value, so it should not impact the mangling of the
function, and the layout is the same as `std::optional`, so it should be
mostly okay. This function doesn't appear to have users, and the ABI was
already broken 2 years ago for concurrency and no one seemed to notice
so this should be "okay".

I'm doing the migration incrementally so that folks working on main can
cherry-pick back to the release/5.9 branch. Once 5.9 is done and locked
away, then we can go through and finish the replacement. Since `None`
and `Optional` show up in contexts where they are not `llvm::None` and
`llvm::Optional`, I'm preparing the work now by going through and
removing the namespace unwrapping and making the `llvm` namespace
explicit. This should make it fairly mechanical to go through and
replace llvm::Optional with std::optional, and llvm::None with
std::nullopt. It's also a change that can be brought onto the
release/5.9 with minimal impact. This should be an NFC change.
2023-06-27 09:03:52 -07:00
shreyaa-sharmaa
2b11d7acc7 Task SR-14138 Replace std::transform with llvm::transform 2021-02-04 12:58:33 +05:30
Varun Gandhi
52dcd47456 [NFC] Remove redundant includes for llvm/ADT/SmallString.h. 2020-05-31 13:07:45 -07:00
Saleem Abdulrasool
326d42378e Basic: convert UUIDs to uppercase
Darwin does not follow the ITEF specification (RFC 4122) and emits the UUID in
uppercase and expects the emission to be uppercase.  Convert to upper case when
translating the UUID from the binary representation to the string
representation.  This repairs the SIL parsing tests on Windows.
2018-12-21 10:43:20 -08:00
Saleem Abdulrasool
5db0c06d0b Revert "Fix linker failures compiling Swift on Windows"
Restore the use of `UuidFromStringA`.  This avoids the unnecessary
round-tripping through mbtowcs and the dynamic allocation.  It also
fixes the UUID parsing, enabling tests to work on Windows.

This reverts commit 9414f46731.
2018-03-09 13:50:49 -08:00
Hugh Bellamy
9414f46731 Fix linker failures compiling Swift on Windows 2017-01-14 21:01:55 +00:00
Slava Pestov
624073a677 Merge pull request #6460 from hughbe/libuuid-windows
Fix linking libuuid on Windows
2017-01-09 18:52:59 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Hugh Bellamy
beafffb9ff Fix linking libuuid on Windows 2016-12-23 11:08:32 +00:00
Hugh Bellamy
56dfb08727 Port swift/basic to Windows 2016-12-02 16:57:00 +00:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Emanuel Zephir
b013be97a8 Always print UUIDs using uppercase.
This changes UUID::toString() to always print using upper case. The previous
behavior was platform specific, resulting in difficulty checking UUIDs in tests.
Serialization/basic_sil.swift and SIL/Parser/basic.sil are now expected to pass
on Linux. This resolves bug SR-417.
2015-12-30 03:26:56 -08:00
practicalswift
cd7d8dfaff Fix alignment as requested by @gribozavr in #692 2015-12-21 08:54:24 +01:00
practicalswift
176f487d76 Fix incorrect filenames in headers. 2015-12-20 23:59:05 +01:00
Doug Gregor
f4d98da668 Support the use of members of protocol extensions on existential types.
To use members of protocol extensions on existential types, we
introduce an OpenExistentialExpr expression to open up the existential
type (into a local archetype) and perform the operations on that local
archetype.

Unlike with uses of initializers or dynamic-Self-producing
methods of protocols, which produce similar ASTs, we have the type
checker perform the "open" operation and then track it through
constraint application. This scheme is better (because it's more
direct), but it's still using a simplistic approach to deciding where
the actual OpenExistentialExpr goes that needs improvement.

Swift SVN r26964
2015-04-04 00:00:14 +00:00
Jordan Rose
042569a3be Optional: Replace uses of Nothing with None.
llvm::Optional (like Swift.Optional!) uses None as its placeholder value,
not Nothing.

Swift SVN r22476
2014-10-02 18:51:42 +00:00
Dmitri Hrybenko
dad84989e3 Don't assume 'uuid_string_t' type is defined
It is not defined on Linux.

Swift SVN r22413
2014-09-30 22:37:42 +00:00
Joe Groff
ff8d6411c0 Push uuid system dependencies out of header.
Swift SVN r22412
2014-09-30 22:32:57 +00:00