Skip to content

Commit b5a36cf

Browse files
authored
Merge pull request #71030 from tshortli/resolve-even-more-warnings
Resolve even more warnings
2 parents 08aa6c2 + ca555c8 commit b5a36cf

File tree

5 files changed

+20
-2
lines changed

5 files changed

+20
-2
lines changed

include/swift/ABI/Task.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ static_assert(alignof(Job) == 2 * alignof(void*),
170170
class NullaryContinuationJob : public Job {
171171

172172
private:
173-
AsyncTask* Task;
174-
AsyncTask* Continuation;
173+
SWIFT_ATTRIBUTE_UNUSED AsyncTask *Task;
174+
AsyncTask *Continuation;
175175

176176
public:
177177
NullaryContinuationJob(AsyncTask *task, JobPriority priority, AsyncTask *continuation)

include/swift/Basic/Compiler.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@
9898
#define SWIFT_ATTRIBUTE_NORETURN
9999
#endif
100100

101+
#if __has_attribute(unused)
102+
#define SWIFT_ATTRIBUTE_UNUSED __attribute__((__unused__))
103+
#else
104+
#define SWIFT_ATTRIBUTE_UNUSED
105+
#endif
106+
101107
#ifndef SWIFT_BUG_REPORT_URL
102108
#define SWIFT_BUG_REPORT_URL "https://swift.org/contributing/#reporting-bugs"
103109
#endif

lib/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,13 @@ list(APPEND LLVM_COMMON_DEPENDS intrinsics_gen clang-tablegen-targets)
1919
file(GENERATE
2020
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HeaderDependencies.cpp"
2121
CONTENT "
22+
#ifndef COMPILED_WITH_SWIFT
2223
#define COMPILED_WITH_SWIFT
24+
#endif
25+
26+
#ifndef SWIFT_TARGET
2327
#define SWIFT_TARGET
28+
#endif
2429
2530
#include \"swift/Basic/BasicBridging.h\"
2631
#include \"swift/AST/ASTBridging.h\"

stdlib/public/Concurrency/Task.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,6 +1635,8 @@ static void swift_task_asyncMainDrainQueueImpl() {
16351635
swift_task_donateThreadToGlobalExecutorUntil([](void *context) {
16361636
return *reinterpret_cast<bool*>(context);
16371637
}, &Finished);
1638+
swift_unreachable(
1639+
"Returned from swift_task_donateThreadToGlobalExecutorUntil()");
16381640
#elif !SWIFT_CONCURRENCY_ENABLE_DISPATCH
16391641
// FIXME: consider implementing a concurrent global main queue for
16401642
// these environments?

stdlib/toolchain/Compatibility56/Concurrency/TaskAlloc.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ static TaskAllocator &allocator(AsyncTask *task) {
4141
// FIXME: this fall-back shouldn't be necessary, but it's useful
4242
// for now, since the current execution tests aren't setting up a task
4343
// properly.
44+
45+
// https://github.com/apple/swift/issues/62761
46+
#pragma clang diagnostic push
47+
#pragma clang diagnostic ignored "-Wexit-time-destructors"
4448
static GlobalAllocator global;
49+
#pragma clang diagnostic pop
4550
return global.allocator;
4651
}
4752

0 commit comments

Comments
 (0)