Commit Graph

23 Commits

Author SHA1 Message Date
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
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
Jason Mittertreiner
8998235ed6 Enable Child Memory Usage Tracking on Windows (#23686)
Windows requires a handle to get memory usage, so do a slight refactor
to collect the child's memory usage as it exits instead of as the parent
is cleaning up.
2019-03-30 18:54:30 -07:00
Adrian Prantl
ff63eaea6f Remove \brief commands from doxygen comments.
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.

Patch produced by

      for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
2018-12-04 15:45:04 -08:00
Bob Wilson
b2821e70f9 [master-next] Use new llvm::sys::procid_t type from LLVM r334294
Use llvm::sys::procid_t instead of llvm::sys::ProcessInfo::ProcessId.
Patch by Jason Molenda
rdar://problem/41025619
2018-06-12 14:50:29 -07:00
Benjamin Herzog
ac10fb3462 [Driver] Added process information to emitted messages
When providing the -parseable-output flag to the swift compiler, it will provide json formatted messages about tasks that run.
I added some optional usage information in form of user time, system time and maxrss to the output. This can be used by other tools using the compiler to get some insights about time and memory usage.
Since the output does not longer match processes run (in batch mode), I also added a real_pid field so the client could reason about jobs that belong together if needed.

rdar://39798231
2018-05-25 13:12:57 -07:00
Huon Wilson
b866e43265 [NFC] Squash \param documentation warning. 2018-04-24 13:30:35 +10:00
Graydon Hoare
c1682fa465 [Driver] <rdar://39504759> Continue demultiplexing subprocess output after initial read. 2018-04-18 11:52:11 -07:00
Sho Ikeda
9c3e4848bf [gardening][Basic] Replace typedef with using 2018-03-28 21:27:26 +09:00
Graydon Hoare
7686a5af20 [BatchMode] Fix a bug in DummyTaskQueue uncovered by recent change. 2018-02-15 15:38:09 -08:00
Matthew Carroll
5497bfb7b4 SR-3175: Include the terminating signal number in the driver output
* Add the signal number of the terminated task to the output of the driver on platforms for which the signal number is available. The new key in the parseable driver output is "signal".
* Add a test to verify that the signal number is emitted.
* Add documentation for the new "signal" key emitted in the parseable driver output.

https://bugs.swift.org/browse/SR-3175
2017-01-13 13:48:41 -05:00
Sean Callanan
399709ccb8 Optionally separate Tasks` stderr from stdout.
Fixes a serious problem where spurious output from xcrun breaks
swift's discovery of libarclite.

<rdar://problem/28573949>
2017-01-11 11:11:23 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01: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
Dan Raviv
29d76f3b68 Canonize swift header files headers and footers
- Added missing ifdef guard in PointerIntEnum header
- Consistent naming convention for ifdef guards
- Consistent 'end namespace swift'
- Consistent single EOL at end of header files
2016-03-23 09:04:12 +02:00
saisi
535d400dc6 Fixed niggling typos 2016-01-29 23:16:25 -05:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Jordan Rose
83f9ed43c3 [Driver] Don't assert when some files /don't/ get rebuilt but we still merge modules.
...or do anything else that depends on the compile commands that get skipped.

Fix-up to rdar://problem/21129029

Swift SVN r29816
2015-06-30 22:37:22 +00:00
Connor Wakamo
b7d4e98f70 [driver] Added support for detecting and reporting crashed subprocesses.
Added a TaskSignalledCallback to TaskQueue, which will be called instead of
TaskFinishedCallback if the task exited abnormally.

In Unix/TaskQueue.inc, check WIFSIGNALED if the task did not pass WIFEXITED,
and call the TaskSignalledCallback if necessary. In Default/TaskQueue.inc, check
for a return code of -2; if present, call the TaskSignalledCallback instead of
the TaskFinishedCallback.

Updated Compilation to pass a TaskSignalledCallback.

Added diagnostics to indicate when a command signalled as well as when a command
failed with either poor diagnostics or a non-1 exit code. (These match Clang’s
diagnostics.) Added tests to ensure these diagnostics are emitted when the
frontend crashes or fails an assertion (if assertions are available).

This fixes <rdar://problem/16012199>.

Swift SVN r13654
2014-02-07 22:03:33 +00:00
Connor Wakamo
b7aec0e72c [driver] Added a DummyTaskQueue class, which calls TaskBeganCallback/TaskFinishedCallback but does not actually execute subtasks.
While this is not yet used, Compilation will be able to adopt this for easier testing of driver-level task execution (instead of forcing all driver-level tests to invoke the frontend, linker, etc.).

Swift SVN r12349
2014-01-15 21:27:55 +00:00
Connor Wakamo
dd9614e80c [driver] Add TaskQueue::getNumberOfParallelTasks().
For the Unix implementation, this returns NumberOfParallelTasks (unless that value is 0, in which case it returns the default value of 1).
For the Default implementation, this always returns 1, since it does not support parallelism.

Swift SVN r12348
2014-01-15 21:27:50 +00:00
Connor Wakamo
ed061a5bfa [driver] Introduced a new TaskQueue class for parallel execution and output buffering.
Due to the nature of this class, there are two implementations of TaskQueue:
a Unix-specific implementation which supports both parallel execution and output
buffering, and a default implementation which supports neither of these features.
(The default implementation uses the functions from llvm/Support/Program.h for execution.)

TaskQueue allows clients to provide a TaskBeganCallback and a TaskFinishedCallback,
each of which will be called when a new task begins or when a task finishes execution,
respectively. Clients may add tasks to the TaskQueue in either of these callbacks,
and clients can stop further execution by returning TaskFinishedResponse::StopExecution
from the TaskFinishedCallback.

Swift SVN r12059
2014-01-08 19:10:41 +00:00