mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #78766 from tshortli/warnings
IRGen/Runtime: Suppress some warnings
This commit is contained in:
@@ -1035,28 +1035,6 @@ static llvm::MemoryEffects mergeMemoryEffects(ArrayRef<llvm::MemoryEffects> effe
|
||||
return mergedEffects;
|
||||
}
|
||||
|
||||
|
||||
namespace {
|
||||
bool isStandardLibrary(const llvm::Module &M) {
|
||||
if (auto *Flags = M.getNamedMetadata("swift.module.flags")) {
|
||||
for (const auto *F : Flags->operands()) {
|
||||
const auto *Key = dyn_cast_or_null<llvm::MDString>(F->getOperand(0));
|
||||
if (!Key)
|
||||
continue;
|
||||
|
||||
const auto *Value =
|
||||
dyn_cast_or_null<llvm::ConstantAsMetadata>(F->getOperand(1));
|
||||
if (!Value)
|
||||
continue;
|
||||
|
||||
if (Key->getString() == "standard-library")
|
||||
return cast<llvm::ConstantInt>(Value->getValue())->isOne();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
llvm::FunctionType *swift::getRuntimeFnType(llvm::Module &Module,
|
||||
llvm::ArrayRef<llvm::Type*> retTypes,
|
||||
llvm::ArrayRef<llvm::Type*> argTypes) {
|
||||
|
||||
@@ -439,6 +439,8 @@ namespace {
|
||||
} // end anonymous namespace
|
||||
|
||||
namespace swift {
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Winvalid-offsetof"
|
||||
struct StaticAssertGenericMetadataCacheEntryValueOffset {
|
||||
static_assert(
|
||||
offsetof(GenericCacheEntry, Value) ==
|
||||
@@ -446,6 +448,7 @@ namespace swift {
|
||||
Value),
|
||||
"The generic metadata cache entry layout mismatch");
|
||||
};
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -179,8 +179,11 @@ SWIFT_CC(swiftasync)
|
||||
static void task_wait_throwing_resume_adapter(SWIFT_ASYNC_CONTEXT AsyncContext *_context) {
|
||||
|
||||
auto context = static_cast<TaskFutureWaitAsyncContext *>(_context);
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
|
||||
auto resumeWithError =
|
||||
reinterpret_cast<AsyncVoidClosureEntryPoint *>(context->ResumeParent);
|
||||
#pragma clang diagnostic pop
|
||||
return resumeWithError(context->Parent, context->errorResult);
|
||||
}
|
||||
|
||||
@@ -212,7 +215,10 @@ void SWIFT_CC(swiftasync) swift::swift56override_swift_task_future_wait_throwing
|
||||
waitingTask->ResumeTask = task_wait_throwing_resume_adapter;
|
||||
waitingTask->ResumeContext = callContext;
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
|
||||
auto resumeFn = reinterpret_cast<TaskContinuationFunction *>(resumeFunction);
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
// Wait on the future.
|
||||
assert(task->isFuture());
|
||||
|
||||
Reference in New Issue
Block a user