mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
[llvm] Use *Set::contains (NFC)
This commit is contained in:
parent
04ea28f569
commit
2fa31266e2
@ -2574,7 +2574,7 @@ static void removeOldExitPreds(RegionMRT *Region) {
|
||||
static bool mbbHasBackEdge(MachineBasicBlock *MBB,
|
||||
SmallPtrSet<MachineBasicBlock *, 8> &MBBs) {
|
||||
for (auto SI = MBB->succ_begin(), SE = MBB->succ_end(); SI != SE; ++SI) {
|
||||
if (MBBs.count(*SI) != 0) {
|
||||
if (MBBs.contains(*SI)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ bool FileAnalysis::willTrapOnCFIViolation(const Instr &InstrMeta) const {
|
||||
if (!MIA->evaluateBranch(InstrMeta.Instruction, InstrMeta.VMAddress,
|
||||
InstrMeta.InstructionSize, Target))
|
||||
return false;
|
||||
return TrapOnFailFunctionAddresses.count(Target) > 0;
|
||||
return TrapOnFailFunctionAddresses.contains(Target);
|
||||
}
|
||||
|
||||
bool FileAnalysis::canFallThrough(const Instr &InstrMeta) const {
|
||||
@ -558,7 +558,7 @@ Error FileAnalysis::parseSymbolTable() {
|
||||
auto SymNameOrErr = Sym.getName();
|
||||
if (!SymNameOrErr)
|
||||
consumeError(SymNameOrErr.takeError());
|
||||
else if (TrapOnFailFunctions.count(*SymNameOrErr) > 0) {
|
||||
else if (TrapOnFailFunctions.contains(*SymNameOrErr)) {
|
||||
auto AddrOrErr = Sym.getAddress();
|
||||
if (!AddrOrErr)
|
||||
consumeError(AddrOrErr.takeError());
|
||||
@ -574,7 +574,7 @@ Error FileAnalysis::parseSymbolTable() {
|
||||
auto SymNameOrErr = Sym.getName();
|
||||
if (!SymNameOrErr)
|
||||
consumeError(SymNameOrErr.takeError());
|
||||
else if (TrapOnFailFunctions.count(*SymNameOrErr) > 0)
|
||||
else if (TrapOnFailFunctions.contains(*SymNameOrErr))
|
||||
TrapOnFailFunctionAddresses.insert(Addr.second);
|
||||
}
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ const Section *Object::findSection(ssize_t UniqueId) const {
|
||||
void Object::removeSections(function_ref<bool(const Section &)> ToRemove) {
|
||||
DenseSet<ssize_t> AssociatedSections;
|
||||
auto RemoveAssociated = [&AssociatedSections](const Section &Sec) {
|
||||
return AssociatedSections.count(Sec.UniqueId) == 1;
|
||||
return AssociatedSections.contains(Sec.UniqueId);
|
||||
};
|
||||
do {
|
||||
DenseSet<ssize_t> RemovedSections;
|
||||
@ -109,7 +109,7 @@ void Object::removeSections(function_ref<bool(const Section &)> ToRemove) {
|
||||
// leave them dangling).
|
||||
if (RemovedSections.count(Sym.AssociativeComdatTargetSectionId) == 1)
|
||||
AssociatedSections.insert(Sym.TargetSectionId);
|
||||
return RemovedSections.count(Sym.TargetSectionId) == 1;
|
||||
return RemovedSections.contains(Sym.TargetSectionId);
|
||||
});
|
||||
ToRemove = RemoveAssociated;
|
||||
} while (!AssociatedSections.empty());
|
||||
|
@ -178,10 +178,10 @@ static Error processLoadCommands(const CopyConfig &Config, Object &Obj) {
|
||||
for (const auto &OldNew : Config.RPathsToUpdate) {
|
||||
StringRef Old = OldNew.getFirst();
|
||||
StringRef New = OldNew.getSecond();
|
||||
if (RPaths.count(Old) == 0)
|
||||
if (!RPaths.contains(Old))
|
||||
return createStringError(errc::invalid_argument,
|
||||
"no LC_RPATH load command with path: " + Old);
|
||||
if (RPaths.count(New) != 0)
|
||||
if (RPaths.contains(New))
|
||||
return createStringError(errc::invalid_argument,
|
||||
"rpath '" + New +
|
||||
"' would create a duplicate load command");
|
||||
@ -220,7 +220,7 @@ static Error processLoadCommands(const CopyConfig &Config, Object &Obj) {
|
||||
|
||||
// Add new RPaths.
|
||||
for (StringRef RPath : Config.RPathToAdd) {
|
||||
if (RPaths.count(RPath) != 0)
|
||||
if (RPaths.contains(RPath))
|
||||
return createStringError(errc::invalid_argument,
|
||||
"rpath '" + RPath +
|
||||
"' would create a duplicate load command");
|
||||
@ -229,7 +229,7 @@ static Error processLoadCommands(const CopyConfig &Config, Object &Obj) {
|
||||
}
|
||||
|
||||
for (StringRef RPath : Config.RPathToPrepend) {
|
||||
if (RPaths.count(RPath) != 0)
|
||||
if (RPaths.contains(RPath))
|
||||
return createStringError(errc::invalid_argument,
|
||||
"rpath '" + RPath +
|
||||
"' would create a duplicate load command");
|
||||
|
Loading…
Reference in New Issue
Block a user