Skip to content

Commit 61a8942

Browse files
committed
fix warning
Created using spr 1.3.5-bogner
1 parent 7e5d67b commit 61a8942

File tree

17 files changed

+30
-35
lines changed

17 files changed

+30
-35
lines changed

llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,8 @@ void AArch64AsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
458458
// Shift the value into position.
459459
Value <<= Info.TargetOffset;
460460

461-
unsigned Offset = Fixup.getOffset();
462-
assert(Offset + NumBytes <= F.getSize() && "Invalid fixup offset!");
461+
assert(Fixup.getOffset() + NumBytes <= F.getSize() &&
462+
"Invalid fixup offset!");
463463

464464
// Used to point to big endian bytes.
465465
unsigned FulleSizeInBytes = getFixupKindContainereSizeInBytes(Fixup.getKind());
@@ -473,7 +473,8 @@ void AArch64AsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
473473
}
474474
} else {
475475
// Handle as big-endian
476-
assert(Offset + FulleSizeInBytes <= F.getSize() && "Invalid fixup size!");
476+
assert(Fixup.getOffset() + FulleSizeInBytes <= F.getSize() &&
477+
"Invalid fixup size!");
477478
assert(NumBytes <= FulleSizeInBytes && "Invalid fixup size!");
478479
for (unsigned i = 0; i != NumBytes; ++i) {
479480
unsigned Idx = FulleSizeInBytes - 1 - i;

llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ void AMDGPUAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
146146
Value <<= Info.TargetOffset;
147147

148148
unsigned NumBytes = getFixupKindNumBytes(Fixup.getKind());
149-
uint32_t Offset = Fixup.getOffset();
150-
assert(Offset + NumBytes <= F.getSize() && "Invalid fixup offset!");
149+
assert(Fixup.getOffset() + NumBytes <= F.getSize() &&
150+
"Invalid fixup offset!");
151151

152152
// For each byte of the fragment that the fixup touches, mask in the bits from
153153
// the fixup value.

llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,14 +1123,15 @@ void ARMAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
11231123
return; // Doesn't change encoding.
11241124
const unsigned NumBytes = getFixupKindNumBytes(Kind);
11251125

1126-
unsigned Offset = Fixup.getOffset();
1127-
assert(Offset + NumBytes <= F.getSize() && "Invalid fixup offset!");
1126+
assert(Fixup.getOffset() + NumBytes <= F.getSize() &&
1127+
"Invalid fixup offset!");
11281128

11291129
// Used to point to big endian bytes.
11301130
unsigned FullSizeBytes;
11311131
if (Endian == llvm::endianness::big) {
11321132
FullSizeBytes = getFixupKindContainerSizeBytes(Kind);
1133-
assert((Offset + FullSizeBytes) <= F.getSize() && "Invalid fixup size!");
1133+
assert(Fixup.getOffset() + FullSizeBytes <= F.getSize() &&
1134+
"Invalid fixup size!");
11341135
assert(NumBytes <= FullSizeBytes && "Invalid fixup size!");
11351136
}
11361137

llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,8 @@ void AVRAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
396396
// Shift the value into position.
397397
Value <<= Info.TargetOffset;
398398

399-
unsigned Offset = Fixup.getOffset();
400-
assert(Offset + NumBytes <= F.getSize() && "Invalid fixup offset!");
399+
assert(Fixup.getOffset() + NumBytes <= F.getSize() &&
400+
"Invalid fixup offset!");
401401

402402
// For each byte of the fragment that the fixup touches, mask in the
403403
// bits from the fixup value.

llvm/lib/Target/CSKY/MCTargetDesc/CSKYAsmBackend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,10 @@ void CSKYAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
216216
// Shift the value into position.
217217
Value <<= Info.TargetOffset;
218218

219-
unsigned Offset = Fixup.getOffset();
220219
unsigned NumBytes = alignTo(Info.TargetSize + Info.TargetOffset, 8) / 8;
221220

222-
assert(Offset + NumBytes <= F.getSize() && "Invalid fixup offset!");
221+
assert(Fixup.getOffset() + NumBytes <= F.getSize() &&
222+
"Invalid fixup offset!");
223223

224224
// For each byte of the fragment that the fixup touches, mask in the
225225
// bits from the fixup value.

llvm/lib/Target/Hexagon/MCTargetDesc/HexagonAsmBackend.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -665,9 +665,9 @@ void HexagonAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
665665

666666
// LLVM gives us an encoded value, we have to convert it back
667667
// to a real offset before we can use it.
668-
uint32_t Offset = Fixup.getOffset();
669668
unsigned NumBytes = getFixupKindNumBytes(Kind);
670-
assert(Offset + NumBytes <= F.getSize() && "Invalid fixup offset!");
669+
assert(Fixup.getOffset() + NumBytes <= F.getSize() &&
670+
"Invalid fixup offset!");
671671

672672
Value = adjustFixupValue(Kind, FixupValue);
673673
if (!Value)
@@ -754,8 +754,8 @@ void HexagonAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
754754
uint32_t OldData = 0; for (unsigned i = 0; i < NumBytes; i++) OldData |=
755755
(InstAddr[i] << (i * 8)) & (0xff << (i * 8));
756756
dbgs() << "\tBValue=0x"; dbgs().write_hex(Value) << ": AValue=0x";
757-
dbgs().write_hex(FixupValue)
758-
<< ": Offset=" << Offset << ": Size=" << F.getSize() << ": OInst=0x";
757+
dbgs().write_hex(FixupValue) << ": Offset=" << Fixup.getOffset()
758+
<< ": Size=" << F.getSize() << ": OInst=0x";
759759
dbgs().write_hex(OldData) << ": Reloc=0x"; dbgs().write_hex(Reloc););
760760

761761
// For each byte of the fragment that the fixup touches, mask in the

llvm/lib/Target/Lanai/MCTargetDesc/LanaiAsmBackend.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ void LanaiAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
8383

8484
// Where in the object and where the number of bytes that need
8585
// fixing up
86-
unsigned Offset = Fixup.getOffset();
8786
unsigned NumBytes = (getFixupKindInfo(Kind).TargetSize + 7) / 8;
8887
unsigned FullSize = 4;
8988

llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ void LoongArchAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
165165
// Shift the value into position.
166166
Value <<= Info.TargetOffset;
167167

168-
unsigned Offset = Fixup.getOffset();
169168
unsigned NumBytes = alignTo(Info.TargetSize + Info.TargetOffset, 8) / 8;
170169

171-
assert(Offset + NumBytes <= F.getSize() && "Invalid fixup offset!");
170+
assert(Fixup.getOffset() + NumBytes <= F.getSize() &&
171+
"Invalid fixup offset!");
172172
// For each byte of the fragment that the fixup touches, mask in the
173173
// bits from the fixup value.
174174
for (unsigned I = 0; I != NumBytes; ++I) {

llvm/lib/Target/MSP430/MCTargetDesc/MSP430AsmBackend.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,9 @@ void MSP430AsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
115115
// Shift the value into position.
116116
Value <<= Info.TargetOffset;
117117

118-
unsigned Offset = Fixup.getOffset();
119118
unsigned NumBytes = alignTo(Info.TargetSize + Info.TargetOffset, 8) / 8;
120-
121-
assert(Offset + NumBytes <= F.getSize() && "Invalid fixup offset!");
119+
assert(Fixup.getOffset() + NumBytes <= F.getSize() &&
120+
"Invalid fixup offset!");
122121

123122
// For each byte of the fragment that the fixup touches, mask in the
124123
// bits from the fixup value.

llvm/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ void MipsAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
296296
return; // Doesn't change encoding.
297297

298298
// Where do we start in the object
299-
unsigned Offset = Fixup.getOffset();
300299
// Number of bytes we need to fixup
301300
unsigned NumBytes = (getFixupKindInfo(Kind).TargetSize + 7) / 8;
302301
// Used to point to big endian bytes

0 commit comments

Comments
 (0)