Skip to content

Commit 478dc96

Browse files
authored
Merge pull request swiftlang#70904 from tshortli/resolve-warnings
NFC: Resolve a bunch of warnings
2 parents 2557183 + d55c28b commit 478dc96

File tree

7 files changed

+18
-9
lines changed

7 files changed

+18
-9
lines changed

lib/Parse/ParseDecl.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7929,7 +7929,6 @@ void Parser::parseExpandedMemberList(SmallVectorImpl<ASTNode> &items) {
79297929
consumeTokenWithoutFeedingReceiver();
79307930

79317931
auto *decl = CurDeclContext->getAsDecl();
7932-
auto *idc = dyn_cast<IterableDeclContext>(decl);
79337932
bool previousHadSemi = true;
79347933

79357934
SourceLoc startingLoc = Tok.getLoc();

lib/SIL/Utils/InstructionUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ RuntimeEffect swift::getRuntimeEffect(SILInstruction *inst, SILType &impactType)
917917
auto as = ApplySite(inst);
918918

919919
switch (as.getSubstCalleeType()->getRepresentation()) {
920-
case SILFunctionTypeRepresentation::ObjCMethod: {
920+
case SILFunctionTypeRepresentation::ObjCMethod:
921921
if (auto *callee = as.getCalleeFunction()) {
922922
if (auto *clangDecl = callee->getClangDecl()) {
923923
if (auto clangMethodDecl = dyn_cast<clang::ObjCMethodDecl>(clangDecl)) {
@@ -927,7 +927,7 @@ RuntimeEffect swift::getRuntimeEffect(SILInstruction *inst, SILType &impactType)
927927
}
928928
}
929929
}
930-
}
930+
LLVM_FALLTHROUGH;
931931
case SILFunctionTypeRepresentation::Block:
932932
rt |= RuntimeEffect::ObjectiveC | RuntimeEffect::MetaData;
933933
break;

lib/SILOptimizer/SemanticARC/Transforms.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct Context;
3333
///
3434
/// \returns true if we converted atleast one phi from owned -> guaranteed and
3535
/// eliminated ARC traffic as a result.
36-
bool tryConvertOwnedPhisToGuaranteedPhis(Context &ctx) LLVM_LIBRARY_VISIBILITY;
36+
LLVM_LIBRARY_VISIBILITY bool tryConvertOwnedPhisToGuaranteedPhis(Context &ctx);
3737

3838
} // namespace semanticarc
3939
} // namespace swift

stdlib/public/runtime/BytecodeLayouts.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ static void singlePayloadEnumGeneric(const Metadata *metadata,
396396
auto tagBytesAndOffset = reader.readBytes<uint64_t>();
397397
auto payloadSize = reader.readBytes<size_t>();
398398
auto *xiType = reader.readBytes<const Metadata *>();
399-
auto numEmptyCases = reader.readBytes<unsigned>();
399+
(void)reader.readBytes<unsigned>();
400400
auto refCountBytes = reader.readBytes<size_t>();
401401
auto skip = reader.readBytes<size_t>();
402402

@@ -616,7 +616,7 @@ static void singlePayloadEnumGeneric(const Metadata *metadata,
616616
auto tagBytesAndOffset = reader.readBytes<uint64_t>();
617617
auto payloadSize = reader.readBytes<size_t>();
618618
auto *xiType = reader.readBytes<const Metadata *>();
619-
auto numEmptyCases = reader.readBytes<unsigned>();
619+
(void)reader.readBytes<unsigned>(); // numEmptyCases
620620
auto refCountBytes = reader.readBytes<size_t>();
621621
auto skip = reader.readBytes<size_t>();
622622

@@ -1655,7 +1655,7 @@ static void singlePayloadEnumGenericAssignWithCopy(const Metadata *metadata,
16551655
auto tagBytesAndOffset = reader.readBytes<uint64_t>();
16561656
auto payloadSize = reader.readBytes<size_t>();
16571657
auto *xiType = reader.readBytes<const Metadata *>();
1658-
auto numEmptyCases = reader.readBytes<unsigned>();
1658+
(void)reader.readBytes<unsigned>(); // numEmptyCases
16591659
auto refCountBytes = reader.readBytes<size_t>();
16601660
auto skip = reader.readBytes<size_t>();
16611661

stdlib/public/runtime/ErrorObject.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ - (void)dealloc {
110110
auto copy = type->allocateBufferIn(&copyBuf);
111111
error->type->vw_initializeWithCopy(copy, const_cast<OpaqueValue *>(value));
112112

113-
auto description = getDescription(copy, type);
113+
id description = getDescription(copy, type);
114114
type->deallocateBufferIn(&copyBuf);
115115
return description;
116116
}

stdlib/public/runtime/ProtocolConformance.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1330,7 +1330,8 @@ satisfiesLayoutConstraint(const GenericRequirementDescriptor &req,
13301330
}
13311331

13321332
// Unknown layout.
1333-
return TYPE_LOOKUP_ERROR_FMT("unknown layout kind %u", req.getLayout());
1333+
return TYPE_LOOKUP_ERROR_FMT("unknown layout kind %u",
1334+
static_cast<uint32_t>(req.getLayout()));
13341335
}
13351336

13361337
SWIFT_CC(swift)

stdlib/toolchain/Compatibility56/include/Concurrency/Threading/Mutex.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,26 +982,35 @@ using SmallMutex =
982982

983983
// Enforce literal requirements for static variants.
984984
#if SWIFT_MUTEX_SUPPORTS_CONSTEXPR
985+
#pragma clang diagnostic push
986+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
985987
static_assert(std::is_literal_type<StaticMutex>::value,
986988
"StaticMutex must be literal type");
987989
static_assert(std::is_literal_type<StaticUnsafeMutex>::value,
988990
"StaticUnsafeMutex must be literal type");
991+
#pragma clang diagnostic pop
989992
#else
990993
// Your platform doesn't currently support statically allocated Mutex
991994
// you will possibly see global-constructors warnings
992995
#endif
993996

994997
#if SWIFT_CONDITION_SUPPORTS_CONSTEXPR
998+
#pragma clang diagnostic push
999+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
9951000
static_assert(std::is_literal_type<StaticConditionVariable>::value,
9961001
"StaticConditionVariable must be literal type");
1002+
#pragma clang diagnostic pop
9971003
#else
9981004
// Your platform doesn't currently support statically allocated ConditionVar
9991005
// you will possibly see global-constructors warnings
10001006
#endif
10011007

10021008
#if SWIFT_READWRITELOCK_SUPPORTS_CONSTEXPR
1009+
#pragma clang diagnostic push
1010+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
10031011
static_assert(std::is_literal_type<StaticReadWriteLock>::value,
10041012
"StaticReadWriteLock must be literal type");
1013+
#pragma clang diagnostic pop
10051014
#else
10061015
// Your platform doesn't currently support statically allocated ReadWriteLocks
10071016
// you will possibly see global-constructors warnings

0 commit comments

Comments
 (0)