Skip to content

Commit e50b27f

Browse files
authored
Merge pull request #78766 from tshortli/warnings
IRGen/Runtime: Suppress some warnings
2 parents 0720d4f + e45f671 commit e50b27f

File tree

3 files changed

+9
-22
lines changed

3 files changed

+9
-22
lines changed

lib/IRGen/IRGenModule.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,28 +1035,6 @@ static llvm::MemoryEffects mergeMemoryEffects(ArrayRef<llvm::MemoryEffects> effe
10351035
return mergedEffects;
10361036
}
10371037

1038-
1039-
namespace {
1040-
bool isStandardLibrary(const llvm::Module &M) {
1041-
if (auto *Flags = M.getNamedMetadata("swift.module.flags")) {
1042-
for (const auto *F : Flags->operands()) {
1043-
const auto *Key = dyn_cast_or_null<llvm::MDString>(F->getOperand(0));
1044-
if (!Key)
1045-
continue;
1046-
1047-
const auto *Value =
1048-
dyn_cast_or_null<llvm::ConstantAsMetadata>(F->getOperand(1));
1049-
if (!Value)
1050-
continue;
1051-
1052-
if (Key->getString() == "standard-library")
1053-
return cast<llvm::ConstantInt>(Value->getValue())->isOne();
1054-
}
1055-
}
1056-
return false;
1057-
}
1058-
}
1059-
10601038
llvm::FunctionType *swift::getRuntimeFnType(llvm::Module &Module,
10611039
llvm::ArrayRef<llvm::Type*> retTypes,
10621040
llvm::ArrayRef<llvm::Type*> argTypes) {

stdlib/public/runtime/Metadata.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,13 +439,16 @@ namespace {
439439
} // end anonymous namespace
440440

441441
namespace swift {
442+
#pragma clang diagnostic push
443+
#pragma clang diagnostic ignored "-Winvalid-offsetof"
442444
struct StaticAssertGenericMetadataCacheEntryValueOffset {
443445
static_assert(
444446
offsetof(GenericCacheEntry, Value) ==
445447
offsetof(swift::GenericMetadataCacheEntry<InProcess::StoredPointer>,
446448
Value),
447449
"The generic metadata cache entry layout mismatch");
448450
};
451+
#pragma clang diagnostic pop
449452
}
450453

451454
namespace {

stdlib/toolchain/Compatibility56/Concurrency/Task.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,11 @@ SWIFT_CC(swiftasync)
179179
static void task_wait_throwing_resume_adapter(SWIFT_ASYNC_CONTEXT AsyncContext *_context) {
180180

181181
auto context = static_cast<TaskFutureWaitAsyncContext *>(_context);
182+
#pragma clang diagnostic push
183+
#pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
182184
auto resumeWithError =
183185
reinterpret_cast<AsyncVoidClosureEntryPoint *>(context->ResumeParent);
186+
#pragma clang diagnostic pop
184187
return resumeWithError(context->Parent, context->errorResult);
185188
}
186189

@@ -212,7 +215,10 @@ void SWIFT_CC(swiftasync) swift::swift56override_swift_task_future_wait_throwing
212215
waitingTask->ResumeTask = task_wait_throwing_resume_adapter;
213216
waitingTask->ResumeContext = callContext;
214217

218+
#pragma clang diagnostic push
219+
#pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
215220
auto resumeFn = reinterpret_cast<TaskContinuationFunction *>(resumeFunction);
221+
#pragma clang diagnostic pop
216222

217223
// Wait on the future.
218224
assert(task->isFuture());

0 commit comments

Comments
 (0)