Skip to content

Commit

Permalink
[BOLT] Use llvm::is_contained (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata committed Jun 18, 2023
1 parent 9932eb0 commit e7541f5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions bolt/lib/Rewrite/RewriteInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5999,12 +5999,10 @@ uint64_t RewriteInstance::getFileOffsetForAddress(uint64_t Address) const {
}

bool RewriteInstance::willOverwriteSection(StringRef SectionName) {
for (const char *const &OverwriteName : SectionsToOverwrite)
if (SectionName == OverwriteName)
return true;
for (std::string &OverwriteName : DebugSectionsToOverwrite)
if (SectionName == OverwriteName)
return true;
if (llvm::is_contained(SectionsToOverwrite, SectionName))
return true;
if (llvm::is_contained(DebugSectionsToOverwrite, SectionName))
return true;

ErrorOr<BinarySection &> Section = BC->getUniqueSectionByName(SectionName);
return Section && Section->isAllocatable() && Section->isFinalized();
Expand Down

0 comments on commit e7541f5

Please sign in to comment.