Skip to content

Commit f0360a2

Browse files
committed
Fix trivial warnings emitted during a full build.
1 parent cd4bc88 commit f0360a2

File tree

5 files changed

+4
-14
lines changed

5 files changed

+4
-14
lines changed

lib/SILOptimizer/Mandatory/MoveKillsCopyableValuesChecker.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,6 @@ bool MoveKillsCopyableValuesChecker::check() {
380380
//
381381
// TODO: We should add llvm.dbg.addr support for fastisel and also teach
382382
// CodeGen how to handle llvm.dbg.addr better.
383-
bool emittedDiagnostic = false;
384383
while (!valuesToProcess.empty()) {
385384
auto lexicalValue = valuesToProcess.front();
386385
valuesToProcess = valuesToProcess.drop_front(1);
@@ -416,7 +415,6 @@ bool MoveKillsCopyableValuesChecker::check() {
416415
if (livenessInfo.liveness.isWithinBoundary(mvi)) {
417416
LLVM_DEBUG(llvm::dbgs() << " WithinBoundary: Yes!\n");
418417
emitDiagnosticForMove(lexicalValue, varName, mvi);
419-
emittedDiagnostic = true;
420418
} else {
421419
LLVM_DEBUG(llvm::dbgs() << " WithinBoundary: No!\n");
422420
if (auto varInfo = dbgVarInst.getVarInfo()) {

lib/SILOptimizer/SILCombiner/SILCombinerMiscVisitors.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -2259,7 +2259,6 @@ visitAllocRefDynamicInst(AllocRefDynamicInst *ARDI) {
22592259
if (!use || use->getUser() != ARDI)
22602260
return nullptr;
22612261

2262-
auto silTy = AI->getType();
22632262
auto storageTy = AI->getType().getASTType();
22642263
// getContiguousArrayStorageType<SomeClass> =>
22652264
// ContiguousArrayStorage<AnyObject>

stdlib/public/Distributed/DistributedActor.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static DistributedAccessorSignature::ContinuationType
9696
swift_distributed_execute_target_resume;
9797

9898
SWIFT_CC(swiftasync)
99-
static void ::swift_distributed_execute_target_resume(
99+
static void swift_distributed_execute_target_resume(
100100
SWIFT_ASYNC_CONTEXT AsyncContext *context,
101101
SWIFT_CONTEXT SwiftError *error) {
102102
auto parentCtx = context->Parent;
@@ -110,7 +110,7 @@ static void ::swift_distributed_execute_target_resume(
110110
}
111111

112112
SWIFT_CC(swiftasync)
113-
void ::swift_distributed_execute_target(
113+
void swift_distributed_execute_target(
114114
SWIFT_ASYNC_CONTEXT AsyncContext *callerContext,
115115
DefaultActor *actor,
116116
const char *targetNameStart, size_t targetNameLength,

tools/swift-demangle-yamldump/swift-demangle-yamldump.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,7 @@ static llvm::StringRef substrAfter(llvm::StringRef whole,
154154
static void demangle(llvm::raw_ostream &os, llvm::StringRef name,
155155
swift::Demangle::Context &DCtx,
156156
const swift::Demangle::DemangleOptions &options) {
157-
bool hadLeadingUnderscore = false;
158157
if (name.startswith("__")) {
159-
hadLeadingUnderscore = true;
160158
name = name.substr(1);
161159
}
162160
swift::Demangle::NodePointer pointer = DCtx.demangleSymbolAsNode(name);

tools/swift-stdlib-tool/swift-stdlib-tool.cpp

+2-7
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ int parse_fat(int fd, off_t fsize, char *buffer, size_t size,
604604
magic = *(uint32_t *)buffer;
605605
if (magic == FAT_MAGIC || magic == FAT_CIGAM) {
606606
struct fat_header *fh;
607-
uint32_t fat_magic, fat_nfat_arch;
607+
uint32_t fat_nfat_arch;
608608
struct fat_arch *archs;
609609
uint32_t i;
610610

@@ -613,7 +613,6 @@ int parse_fat(int fd, off_t fsize, char *buffer, size_t size,
613613
}
614614

615615
fh = (struct fat_header *)buffer;
616-
fat_magic = OSSwapBigToHostInt32(fh->magic);
617616
fat_nfat_arch = OSSwapBigToHostInt32(fh->nfat_arch);
618617

619618
size_t fat_arch_size;
@@ -645,14 +644,10 @@ int parse_fat(int fd, off_t fsize, char *buffer, size_t size,
645644

646645
for (i = 0; i < fat_nfat_arch; i++) {
647646
int ret;
648-
uint32_t arch_cputype, arch_cpusubtype, arch_offset, arch_size,
649-
arch_align;
647+
uint32_t arch_offset, arch_size;
650648

651-
arch_cputype = OSSwapBigToHostInt32(archs[i].cputype);
652-
arch_cpusubtype = OSSwapBigToHostInt32(archs[i].cpusubtype);
653649
arch_offset = OSSwapBigToHostInt32(archs[i].offset);
654650
arch_size = OSSwapBigToHostInt32(archs[i].size);
655-
arch_align = OSSwapBigToHostInt32(archs[i].align);
656651

657652
/* Check that slice data is after all fat headers and archs */
658653
if (arch_offset < fat_arch_size) {

0 commit comments

Comments
 (0)