Skip to content

Commit 428c580

Browse files
Fix unused variable warnings in release builds. (swiftlang#18755)
1 parent 1958d7a commit 428c580

File tree

8 files changed

+9
-0
lines changed

8 files changed

+9
-0
lines changed

include/swift/SILOptimizer/Analysis/PassManagerVerifierAnalysis.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ namespace swift {
2525
/// All methods are no-ops when asserts are disabled.
2626
class PassManagerVerifierAnalysis : public SILAnalysis {
2727
/// The module that we are processing.
28+
LLVM_ATTRIBUTE_UNUSED
2829
SILModule &mod;
2930

3031
/// The set of "live" functions that we are tracking.

lib/AST/NameLookup.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2112,6 +2112,7 @@ bool DeclContext::lookupAnyObject(DeclName member, NLOptions options,
21122112
auto dc = decl->getDeclContext();
21132113
auto nominal = dc->getAsNominalTypeOrNominalTypeExtensionContext();
21142114
assert(nominal && "Couldn't find nominal type?");
2115+
(void)nominal;
21152116

21162117
// If we didn't see this declaration before, and it's an acceptable
21172118
// result, add it to the list.

lib/FrontendTool/FrontendTool.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ static bool emitSyntax(SourceFile *SF, LangOptions &LangOpts,
283283
auto bufferID = SF->getBufferID();
284284
assert(bufferID && "frontend should have a buffer ID "
285285
"for the main source file");
286+
(void)bufferID;
286287

287288
auto os = getFileOutputStream(OutputFilename, SF->getASTContext());
288289
if (!os) return true;

lib/IDE/CodeCompletionCache.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ static bool readCachedModule(llvm::MemoryBuffer *in,
137137
auto result = llvm::support::endian::read32le(cursor);
138138
cursor += sizeof(result);
139139
assert(cursor <= end);
140+
(void)end;
140141
return result;
141142
};
142143

lib/IRGen/TypeLayoutDumper.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ bool swift::performDumpTypeInfo(IRGenOptions &Opts,
192192
llvm::LLVMContext &LLVMContext) {
193193
auto &Ctx = SILMod.getASTContext();
194194
assert(!Ctx.hadError());
195+
(void)Ctx;
195196

196197
IRGenerator IRGen(Opts, SILMod);
197198
IRGenModule IGM(IRGen, IRGen.createTargetMachine(), LLVMContext);

lib/SILOptimizer/Transforms/AccessEnforcementOpts.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,8 @@ void AccessConflictAndMergeAnalysis::mergePredAccesses(
730730
assert((predRegion->getParentID() == bbRegionParentID) &&
731731
"predecessor is not part of the parent region - unhandled control "
732732
"flow");
733+
(void)predRegion;
734+
(void)bbRegionParentID;
733735
if (localRegionInfos.find(pred) == localRegionInfos.end()) {
734736
// Backedge / irreducable control flow - bail
735737
info.reset();

lib/Sema/CSRanking.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,7 @@ static bool isDeclAsSpecializedAs(TypeChecker &tc, DeclContext *dc,
559559
computeSelfTypeRelationship(tc, dc, decl1, decl2);
560560
auto relationshipKind = selfTypeRelationship.first;
561561
auto conformance = selfTypeRelationship.second;
562+
(void)conformance;
562563
switch (relationshipKind) {
563564
case SelfTypeRelationship::Unrelated:
564565
// Skip the self types parameter entirely.

lib/Sema/DerivedConformanceRawRepresentable.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ deriveRawRepresentable_init(DerivedConformance &derived) {
317317
assert(equatableProto);
318318
assert(tc.conformsToProtocol(rawType, equatableProto, enumDecl, None));
319319
(void)equatableProto;
320+
(void)rawType;
320321

321322
auto *selfDecl = ParamDecl::createSelf(SourceLoc(), parentDC,
322323
/*static*/false, /*inout*/true);

0 commit comments

Comments
 (0)