[Threading] Use llvm::Optional<> rather than making a zero lower bound special.

While most systems aren't going to have their stack bottom at zero,
using llvm::Optional<> here is cleaner.

rdar://90776105
This commit is contained in:
Alastair Houghton
2022-05-24 17:46:33 +01:00
parent 668bcbce4f
commit c401cc34fd
11 changed files with 51 additions and 32 deletions

View File

@@ -19,6 +19,8 @@
#ifndef SWIFT_THREADING_THREAD_H
#define SWIFT_THREADING_THREAD_H
#include "llvm/ADT/Optional.h"
#include "Impl.h"
namespace swift {
@@ -68,7 +70,7 @@ public:
}
// Retrieve the bounds of the current thread's stack
static StackBounds stackBounds() {
static llvm::Optional<StackBounds> stackBounds() {
return threading_impl::thread_get_current_stack_bounds();
}
};