Skip to content

Commit d39095b

Browse files
authored
[BOLT] Remove unused parameter. NFC (#161617)
`Skip` parameter not used/set inside `analyzeRelocation()`.
1 parent 9323fbb commit d39095b

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

bolt/include/bolt/Rewrite/RewriteInstance.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,11 @@ class RewriteInstance {
249249
/// Analyze relocation \p Rel.
250250
/// Return true if the relocation was successfully processed, false otherwise.
251251
/// The \p SymbolName, \p SymbolAddress, \p Addend and \p ExtractedValue
252-
/// parameters will be set on success. The \p Skip argument indicates
253-
/// that the relocation was analyzed, but it must not be processed.
252+
/// parameters will be set on success.
254253
bool analyzeRelocation(const object::RelocationRef &Rel, uint32_t &RType,
255254
std::string &SymbolName, bool &IsSectionRelocation,
256255
uint64_t &SymbolAddress, int64_t &Addend,
257-
uint64_t &ExtractedValue, bool &Skip) const;
256+
uint64_t &ExtractedValue) const;
258257

259258
/// Rewrite non-allocatable sections with modifications.
260259
void rewriteNoteSections();

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2274,8 +2274,7 @@ uint32_t getRelocationSymbol(const ELFObjectFileBase *Obj,
22742274
bool RewriteInstance::analyzeRelocation(
22752275
const RelocationRef &Rel, uint32_t &RType, std::string &SymbolName,
22762276
bool &IsSectionRelocation, uint64_t &SymbolAddress, int64_t &Addend,
2277-
uint64_t &ExtractedValue, bool &Skip) const {
2278-
Skip = false;
2277+
uint64_t &ExtractedValue) const {
22792278
if (!Relocation::isSupported(RType))
22802279
return false;
22812280

@@ -2707,9 +2706,8 @@ void RewriteInstance::handleRelocation(const SectionRef &RelocatedSection,
27072706
int64_t Addend;
27082707
uint64_t ExtractedValue;
27092708
bool IsSectionRelocation;
2710-
bool Skip;
27112709
if (!analyzeRelocation(Rel, RType, SymbolName, IsSectionRelocation,
2712-
SymbolAddress, Addend, ExtractedValue, Skip)) {
2710+
SymbolAddress, Addend, ExtractedValue)) {
27132711
LLVM_DEBUG({
27142712
dbgs() << "BOLT-WARNING: failed to analyze relocation @ offset = "
27152713
<< formatv("{0:x}; type name = {1}\n", Rel.getOffset(), TypeName);
@@ -2718,14 +2716,6 @@ void RewriteInstance::handleRelocation(const SectionRef &RelocatedSection,
27182716
return;
27192717
}
27202718

2721-
if (Skip) {
2722-
LLVM_DEBUG({
2723-
dbgs() << "BOLT-DEBUG: skipping relocation @ offset = "
2724-
<< formatv("{0:x}; type name = {1}\n", Rel.getOffset(), TypeName);
2725-
});
2726-
return;
2727-
}
2728-
27292719
if (!IsFromCode && !IsWritable && (IsX86 || IsAArch64) &&
27302720
Relocation::isPCRelative(RType)) {
27312721
BinaryData *BD = BC->getBinaryDataContainingAddress(Rel.getOffset());

0 commit comments

Comments
 (0)