forked from OSchip/llvm-project
[NFC] Fixes -Wrange-loop-analysis warnings
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall. Differential Revision: https://reviews.llvm.org/D71857
This commit is contained in:
parent
9b24dad6c0
commit
8dc7b982b4
|
@ -215,7 +215,7 @@ static void genMarkdown(const RecordInfo &I, llvm::raw_ostream &OS) {
|
|||
|
||||
if (!I.Members.empty()) {
|
||||
writeHeader("Members", 2, OS);
|
||||
for (const auto Member : I.Members) {
|
||||
for (const auto &Member : I.Members) {
|
||||
std::string Access = getAccess(Member.Access);
|
||||
if (Access != "")
|
||||
writeLine(Access + " " + Member.Type.Name + " " + Member.Name, OS);
|
||||
|
|
|
@ -75,7 +75,7 @@ void SlicingCheck::DiagnoseSlicedOverriddenMethods(
|
|||
const CXXRecordDecl &BaseDecl) {
|
||||
if (DerivedDecl.getCanonicalDecl() == BaseDecl.getCanonicalDecl())
|
||||
return;
|
||||
for (const auto &Method : DerivedDecl.methods()) {
|
||||
for (const auto *Method : DerivedDecl.methods()) {
|
||||
// Virtual destructors are OK. We're ignoring constructors since they are
|
||||
// tagged as overrides.
|
||||
if (isa<CXXConstructorDecl>(Method) || isa<CXXDestructorDecl>(Method))
|
||||
|
|
|
@ -792,7 +792,7 @@ void IdentifierNamingCheck::check(const MatchFinder::MatchResult &Result) {
|
|||
}
|
||||
|
||||
if (const auto *Decl = Result.Nodes.getNodeAs<UsingDecl>("using")) {
|
||||
for (const auto &Shadow : Decl->shadows()) {
|
||||
for (const auto *Shadow : Decl->shadows()) {
|
||||
addUsage(NamingCheckFailures, Shadow->getTargetDecl(),
|
||||
Decl->getNameInfo().getSourceRange());
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ using llvm::SmallPtrSet;
|
|||
namespace {
|
||||
|
||||
template <typename S> bool isSetDifferenceEmpty(const S &S1, const S &S2) {
|
||||
for (const auto &E : S1)
|
||||
for (auto E : S1)
|
||||
if (S2.count(E) == 0)
|
||||
return false;
|
||||
return true;
|
||||
|
|
|
@ -125,7 +125,7 @@ ExceptionAnalyzer::ExceptionInfo ExceptionAnalyzer::throwsException(
|
|||
|
||||
auto Result = ExceptionInfo::createUnknown();
|
||||
if (const auto *FPT = Func->getType()->getAs<FunctionProtoType>()) {
|
||||
for (const QualType Ex : FPT->exceptions())
|
||||
for (const QualType &Ex : FPT->exceptions())
|
||||
Result.registerException(Ex.getTypePtr());
|
||||
}
|
||||
return Result;
|
||||
|
|
|
@ -36,7 +36,7 @@ bool MemIndex::fuzzyFind(
|
|||
Req.Limit ? *Req.Limit : std::numeric_limits<size_t>::max());
|
||||
FuzzyMatcher Filter(Req.Query);
|
||||
bool More = false;
|
||||
for (const auto Pair : Index) {
|
||||
for (const auto &Pair : Index) {
|
||||
const Symbol *Sym = Pair.second;
|
||||
|
||||
// Exact match against all possible scopes.
|
||||
|
|
|
@ -167,7 +167,7 @@ struct MapRegionCounters : public RecursiveASTVisitor<MapRegionCounters> {
|
|||
bool TraverseBlockExpr(BlockExpr *BE) { return true; }
|
||||
bool TraverseLambdaExpr(LambdaExpr *LE) {
|
||||
// Traverse the captures, but not the body.
|
||||
for (const auto &C : zip(LE->captures(), LE->capture_inits()))
|
||||
for (auto C : zip(LE->captures(), LE->capture_inits()))
|
||||
TraverseLambdaCapture(LE, &std::get<0>(C), std::get<1>(C));
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -2423,7 +2423,7 @@ static void emitGlobalDtorWithCXAAtExit(CodeGenFunction &CGF,
|
|||
}
|
||||
|
||||
void CodeGenModule::registerGlobalDtorsWithAtExit() {
|
||||
for (const auto I : DtorsUsingAtExit) {
|
||||
for (const auto &I : DtorsUsingAtExit) {
|
||||
int Priority = I.first;
|
||||
const llvm::TinyPtrVector<llvm::Function *> &Dtors = I.second;
|
||||
|
||||
|
|
|
@ -686,7 +686,7 @@ void MoveChecker::checkDeadSymbols(SymbolReaper &SymReaper,
|
|||
CheckerContext &C) const {
|
||||
ProgramStateRef State = C.getState();
|
||||
TrackedRegionMapTy TrackedRegions = State->get<TrackedRegionMap>();
|
||||
for (const auto &E : TrackedRegions) {
|
||||
for (auto E : TrackedRegions) {
|
||||
const MemRegion *Region = E.first;
|
||||
bool IsRegDead = !SymReaper.isLiveRegion(Region);
|
||||
|
||||
|
|
|
@ -787,7 +787,7 @@ void ASTDiff::Impl::addOptimalMapping(Mapping &M, NodeId Id1,
|
|||
return;
|
||||
ZhangShashaMatcher Matcher(*this, T1, T2, Id1, Id2);
|
||||
std::vector<std::pair<NodeId, NodeId>> R = Matcher.getMatchingNodes();
|
||||
for (const auto Tuple : R) {
|
||||
for (const auto &Tuple : R) {
|
||||
NodeId Src = Tuple.first;
|
||||
NodeId Dst = Tuple.second;
|
||||
if (!M.hasSrc(Src) && !M.hasDst(Dst))
|
||||
|
|
|
@ -74,7 +74,7 @@ bool areChangesSame(const tooling::AtomicChanges &LHS,
|
|||
const tooling::AtomicChanges &RHS) {
|
||||
if (LHS.size() != RHS.size())
|
||||
return false;
|
||||
for (const auto &I : llvm::zip(LHS, RHS)) {
|
||||
for (auto I : llvm::zip(LHS, RHS)) {
|
||||
if (!(std::get<0>(I) == std::get<1>(I)))
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ bool isRSAllocationTyCallSite(llvm::Module &module, llvm::CallInst *call_inst) {
|
|||
(void)module;
|
||||
if (!call_inst->hasByValArgument())
|
||||
return false;
|
||||
for (const auto ¶m : call_inst->operand_values())
|
||||
for (const auto *param : call_inst->operand_values())
|
||||
if (isRSAllocationPtrTy(param->getType()))
|
||||
return true;
|
||||
return false;
|
||||
|
|
|
@ -165,7 +165,7 @@ Status AdbClient::GetDevices(DeviceIDList &device_list) {
|
|||
llvm::SmallVector<llvm::StringRef, 4> devices;
|
||||
response.split(devices, "\n", -1, false);
|
||||
|
||||
for (const auto device : devices)
|
||||
for (const auto &device : devices)
|
||||
device_list.push_back(device.split('\t').first);
|
||||
|
||||
// Force disconnect since ADB closes connection after host:devices response
|
||||
|
|
|
@ -39,7 +39,7 @@ ScriptedStackFrameRecognizer::RecognizeFrame(lldb::StackFrameSP frame) {
|
|||
ValueObjectListSP args =
|
||||
m_interpreter->GetRecognizedArguments(m_python_object_sp, frame);
|
||||
auto args_synthesized = ValueObjectListSP(new ValueObjectList());
|
||||
for (const auto o : args->GetObjects()) {
|
||||
for (const auto &o : args->GetObjects()) {
|
||||
args_synthesized->Append(ValueObjectRecognizerSynthesizedValue::Create(
|
||||
*o, eValueTypeVariableArgument));
|
||||
}
|
||||
|
|
|
@ -208,7 +208,7 @@ public:
|
|||
bool isLoopExiting(const BlockT *BB) const {
|
||||
assert(!isInvalid() && "Loop not in a valid state!");
|
||||
assert(contains(BB) && "Exiting block must be part of the loop");
|
||||
for (const auto &Succ : children<const BlockT *>(BB)) {
|
||||
for (const auto *Succ : children<const BlockT *>(BB)) {
|
||||
if (!contains(Succ))
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ void LoopBase<BlockT, LoopT>::getExitingBlocks(
|
|||
SmallVectorImpl<BlockT *> &ExitingBlocks) const {
|
||||
assert(!isInvalid() && "Loop not in a valid state!");
|
||||
for (const auto BB : blocks())
|
||||
for (const auto &Succ : children<BlockT *>(BB))
|
||||
for (auto *Succ : children<BlockT *>(BB))
|
||||
if (!contains(Succ)) {
|
||||
// Not in current loop? It must be an exit block.
|
||||
ExitingBlocks.push_back(BB);
|
||||
|
@ -63,7 +63,7 @@ void LoopBase<BlockT, LoopT>::getExitBlocks(
|
|||
SmallVectorImpl<BlockT *> &ExitBlocks) const {
|
||||
assert(!isInvalid() && "Loop not in a valid state!");
|
||||
for (const auto BB : blocks())
|
||||
for (const auto &Succ : children<BlockT *>(BB))
|
||||
for (auto *Succ : children<BlockT *>(BB))
|
||||
if (!contains(Succ))
|
||||
// Not in current loop? It must be an exit block.
|
||||
ExitBlocks.push_back(Succ);
|
||||
|
@ -142,7 +142,7 @@ void LoopBase<BlockT, LoopT>::getExitEdges(
|
|||
SmallVectorImpl<Edge> &ExitEdges) const {
|
||||
assert(!isInvalid() && "Loop not in a valid state!");
|
||||
for (const auto BB : blocks())
|
||||
for (const auto &Succ : children<BlockT *>(BB))
|
||||
for (auto *Succ : children<BlockT *>(BB))
|
||||
if (!contains(Succ))
|
||||
// Not in current loop? It must be an exit block.
|
||||
ExitEdges.emplace_back(BB, Succ);
|
||||
|
|
|
@ -778,13 +778,13 @@ protected:
|
|||
NodeRef NewBBSucc = *GraphT::child_begin(NewBB);
|
||||
|
||||
std::vector<NodeRef> PredBlocks;
|
||||
for (const auto &Pred : children<Inverse<N>>(NewBB))
|
||||
for (auto Pred : children<Inverse<N>>(NewBB))
|
||||
PredBlocks.push_back(Pred);
|
||||
|
||||
assert(!PredBlocks.empty() && "No predblocks?");
|
||||
|
||||
bool NewBBDominatesNewBBSucc = true;
|
||||
for (const auto &Pred : children<Inverse<N>>(NewBBSucc)) {
|
||||
for (auto Pred : children<Inverse<N>>(NewBBSucc)) {
|
||||
if (Pred != NewBB && !dominates(NewBBSucc, Pred) &&
|
||||
isReachableFromEntry(Pred)) {
|
||||
NewBBDominatesNewBBSucc = false;
|
||||
|
|
|
@ -233,7 +233,7 @@ void DomTreeUpdater::applyUpdates(ArrayRef<DominatorTree::UpdateType> Updates) {
|
|||
return;
|
||||
|
||||
if (Strategy == UpdateStrategy::Lazy) {
|
||||
for (const auto U : Updates)
|
||||
for (const auto &U : Updates)
|
||||
if (!isSelfDominance(U))
|
||||
PendUpdates.push_back(U);
|
||||
|
||||
|
@ -253,7 +253,7 @@ void DomTreeUpdater::applyUpdatesPermissive(
|
|||
|
||||
SmallSet<std::pair<BasicBlock *, BasicBlock *>, 8> Seen;
|
||||
SmallVector<DominatorTree::UpdateType, 8> DeduplicatedUpdates;
|
||||
for (const auto U : Updates) {
|
||||
for (const auto &U : Updates) {
|
||||
auto Edge = std::make_pair(U.getFrom(), U.getTo());
|
||||
// Because it is illegal to submit updates that have already been applied
|
||||
// and updates to an edge need to be strictly ordered,
|
||||
|
|
|
@ -1494,7 +1494,7 @@ void MemoryDependenceResults::RemoveCachedNonLocalPointerDependencies(
|
|||
if (auto *I = dyn_cast<Instruction>(P.getPointer())) {
|
||||
auto toRemoveIt = ReverseNonLocalDefsCache.find(I);
|
||||
if (toRemoveIt != ReverseNonLocalDefsCache.end()) {
|
||||
for (const auto &entry : toRemoveIt->second)
|
||||
for (const auto *entry : toRemoveIt->second)
|
||||
NonLocalDefsCache.erase(entry);
|
||||
ReverseNonLocalDefsCache.erase(toRemoveIt);
|
||||
}
|
||||
|
|
|
@ -12527,7 +12527,7 @@ PredicatedScalarEvolution::PredicatedScalarEvolution(
|
|||
const PredicatedScalarEvolution &Init)
|
||||
: RewriteMap(Init.RewriteMap), SE(Init.SE), L(Init.L), Preds(Init.Preds),
|
||||
Generation(Init.Generation), BackedgeCount(Init.BackedgeCount) {
|
||||
for (const auto &I : Init.FlagsMap)
|
||||
for (auto I : Init.FlagsMap)
|
||||
FlagsMap.insert(I);
|
||||
}
|
||||
|
||||
|
|
|
@ -1427,7 +1427,7 @@ void HoistSpillHelper::runHoistSpills(
|
|||
}
|
||||
// For spills in SpillsToKeep with LiveReg set (i.e., not original spill),
|
||||
// save them to SpillsToIns.
|
||||
for (const auto Ent : SpillsToKeep) {
|
||||
for (const auto &Ent : SpillsToKeep) {
|
||||
if (Ent.second)
|
||||
SpillsToIns[Ent.first->getBlock()] = Ent.second;
|
||||
}
|
||||
|
@ -1486,7 +1486,7 @@ void HoistSpillHelper::hoistAllSpills() {
|
|||
|
||||
LLVM_DEBUG({
|
||||
dbgs() << "Finally inserted spills in BB: ";
|
||||
for (const auto Ispill : SpillsToIns)
|
||||
for (const auto &Ispill : SpillsToIns)
|
||||
dbgs() << Ispill.first->getNumber() << " ";
|
||||
dbgs() << "\nFinally removed spills in BB: ";
|
||||
for (const auto Rspill : SpillsToRm)
|
||||
|
@ -1501,7 +1501,7 @@ void HoistSpillHelper::hoistAllSpills() {
|
|||
StackIntvl.getValNumInfo(0));
|
||||
|
||||
// Insert hoisted spills.
|
||||
for (auto const Insert : SpillsToIns) {
|
||||
for (auto const &Insert : SpillsToIns) {
|
||||
MachineBasicBlock *BB = Insert.first;
|
||||
unsigned LiveReg = Insert.second;
|
||||
MachineBasicBlock::iterator MI = IPA.getLastInsertPointIter(OrigLI, *BB);
|
||||
|
|
|
@ -1168,7 +1168,7 @@ bool InterleavedLoadCombineImpl::combine(std::list<VectorInfo> &InterleavedLoad,
|
|||
|
||||
// If there are users outside the set to be eliminated, we abort the
|
||||
// transformation. No gain can be expected.
|
||||
for (const auto &U : I->users()) {
|
||||
for (auto *U : I->users()) {
|
||||
if (Is.find(dyn_cast<Instruction>(U)) == Is.end())
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1253,7 +1253,7 @@ void RegAllocFast::allocateBasicBlock(MachineBasicBlock &MBB) {
|
|||
MachineBasicBlock::iterator MII = MBB.begin();
|
||||
|
||||
// Add live-in registers as live.
|
||||
for (const MachineBasicBlock::RegisterMaskPair LI : MBB.liveins())
|
||||
for (const MachineBasicBlock::RegisterMaskPair &LI : MBB.liveins())
|
||||
if (MRI->isAllocatable(LI.PhysReg))
|
||||
definePhysReg(MII, LI.PhysReg, regReserved);
|
||||
|
||||
|
|
|
@ -3038,7 +3038,7 @@ static bool isVectorReductionOp(const User *I) {
|
|||
if (!Visited.insert(User).second)
|
||||
continue;
|
||||
|
||||
for (const auto &U : User->users()) {
|
||||
for (const auto *U : User->users()) {
|
||||
auto Inst = dyn_cast<Instruction>(U);
|
||||
if (!Inst)
|
||||
return false;
|
||||
|
|
|
@ -273,7 +273,7 @@ void TargetLoweringObjectFileELF::emitModuleMetadata(MCStreamer &Streamer,
|
|||
|
||||
Streamer.SwitchSection(S);
|
||||
|
||||
for (const auto &Operand : LinkerOptions->operands()) {
|
||||
for (const auto *Operand : LinkerOptions->operands()) {
|
||||
if (cast<MDNode>(Operand)->getNumOperands() != 2)
|
||||
report_fatal_error("invalid llvm.linker.options");
|
||||
for (const auto &Option : cast<MDNode>(Operand)->operands()) {
|
||||
|
@ -289,7 +289,7 @@ void TargetLoweringObjectFileELF::emitModuleMetadata(MCStreamer &Streamer,
|
|||
|
||||
Streamer.SwitchSection(S);
|
||||
|
||||
for (const auto &Operand : DependentLibraries->operands()) {
|
||||
for (const auto *Operand : DependentLibraries->operands()) {
|
||||
Streamer.EmitBytes(
|
||||
cast<MDString>(cast<MDNode>(Operand)->getOperand(0))->getString());
|
||||
Streamer.EmitIntValue(0, 1);
|
||||
|
@ -885,7 +885,7 @@ void TargetLoweringObjectFileMachO::emitModuleMetadata(MCStreamer &Streamer,
|
|||
Module &M) const {
|
||||
// Emit the linker options if present.
|
||||
if (auto *LinkerOptions = M.getNamedMetadata("llvm.linker.options")) {
|
||||
for (const auto &Option : LinkerOptions->operands()) {
|
||||
for (const auto *Option : LinkerOptions->operands()) {
|
||||
SmallVector<std::string, 4> StrOptions;
|
||||
for (const auto &Piece : cast<MDNode>(Option)->operands())
|
||||
StrOptions.push_back(cast<MDString>(Piece)->getString());
|
||||
|
@ -1449,7 +1449,7 @@ void TargetLoweringObjectFileCOFF::emitModuleMetadata(MCStreamer &Streamer,
|
|||
// linker.
|
||||
MCSection *Sec = getDrectveSection();
|
||||
Streamer.SwitchSection(Sec);
|
||||
for (const auto &Option : LinkerOptions->operands()) {
|
||||
for (const auto *Option : LinkerOptions->operands()) {
|
||||
for (const auto &Piece : cast<MDNode>(Option)->operands()) {
|
||||
// Lead with a space for consistency with our dllexport implementation.
|
||||
std::string Directive(" ");
|
||||
|
|
|
@ -277,7 +277,7 @@ Optional<DWARFFormValue>
|
|||
AppleAcceleratorTable::Entry::lookup(HeaderData::AtomType Atom) const {
|
||||
assert(HdrData && "Dereferencing end iterator?");
|
||||
assert(HdrData->Atoms.size() == Values.size());
|
||||
for (const auto &Tuple : zip_first(HdrData->Atoms, Values)) {
|
||||
for (auto Tuple : zip_first(HdrData->Atoms, Values)) {
|
||||
if (std::get<0>(Tuple).first == Atom)
|
||||
return std::get<1>(Tuple);
|
||||
}
|
||||
|
@ -531,7 +531,7 @@ DWARFDebugNames::Entry::Entry(const NameIndex &NameIdx, const Abbrev &Abbr)
|
|||
Optional<DWARFFormValue>
|
||||
DWARFDebugNames::Entry::lookup(dwarf::Index Index) const {
|
||||
assert(Abbr->Attributes.size() == Values.size());
|
||||
for (const auto &Tuple : zip_first(Abbr->Attributes, Values)) {
|
||||
for (auto Tuple : zip_first(Abbr->Attributes, Values)) {
|
||||
if (std::get<0>(Tuple).Index == Index)
|
||||
return std::get<1>(Tuple);
|
||||
}
|
||||
|
@ -565,7 +565,7 @@ void DWARFDebugNames::Entry::dump(ScopedPrinter &W) const {
|
|||
W.printHex("Abbrev", Abbr->Code);
|
||||
W.startLine() << formatv("Tag: {0}\n", Abbr->Tag);
|
||||
assert(Abbr->Attributes.size() == Values.size());
|
||||
for (const auto &Tuple : zip_first(Abbr->Attributes, Values)) {
|
||||
for (auto Tuple : zip_first(Abbr->Attributes, Values)) {
|
||||
W.startLine() << formatv("{0}: ", std::get<0>(Tuple).Index);
|
||||
std::get<1>(Tuple).dump(W.getOStream());
|
||||
W.getOStream() << '\n';
|
||||
|
|
|
@ -642,7 +642,7 @@ unsigned DWARFVerifier::verifyDebugInfoReferences() {
|
|||
// getting the DIE by offset and emitting an error
|
||||
OS << "Verifying .debug_info references...\n";
|
||||
unsigned NumErrors = 0;
|
||||
for (const std::pair<uint64_t, std::set<uint64_t>> &Pair :
|
||||
for (const std::pair<const uint64_t, std::set<uint64_t>> &Pair :
|
||||
ReferenceToDIEOffsets) {
|
||||
if (DCtx.getDIEForOffset(Pair.first))
|
||||
continue;
|
||||
|
|
|
@ -297,7 +297,7 @@ Optional<ArrayRef<uint8_t>> getBuildID(const ELFFile<ELFT> *Obj) {
|
|||
if (P.p_type != ELF::PT_NOTE)
|
||||
continue;
|
||||
Error Err = Error::success();
|
||||
for (const auto &N : Obj->notes(P, Err))
|
||||
for (auto N : Obj->notes(P, Err))
|
||||
if (N.getType() == ELF::NT_GNU_BUILD_ID && N.getName() == ELF::ELF_NOTE_GNU)
|
||||
return N.getDesc();
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ void CtorDtorRunner::add(iterator_range<CtorDtorIterator> CtorDtors) {
|
|||
JD.getExecutionSession(),
|
||||
(*CtorDtors.begin()).Func->getParent()->getDataLayout());
|
||||
|
||||
for (const auto &CtorDtor : CtorDtors) {
|
||||
for (auto CtorDtor : CtorDtors) {
|
||||
assert(CtorDtor.Func && CtorDtor.Func->hasName() &&
|
||||
"Ctor/Dtor function must be named to be runnable under the JIT");
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ void TypeFinder::run(const Module &M, bool onlyNamed) {
|
|||
}
|
||||
|
||||
for (const auto &NMD : M.named_metadata())
|
||||
for (const auto &MDOp : NMD.operands())
|
||||
for (const auto *MDOp : NMD.operands())
|
||||
incorporateMDNode(MDOp);
|
||||
}
|
||||
|
||||
|
|
|
@ -1099,7 +1099,7 @@ Error IRLinker::linkGlobalValueBody(GlobalValue &Dst, GlobalValue &Src) {
|
|||
}
|
||||
|
||||
void IRLinker::flushRAUWWorklist() {
|
||||
for (const auto Elem : RAUWWorklist) {
|
||||
for (const auto &Elem : RAUWWorklist) {
|
||||
GlobalValue *Old;
|
||||
Value *New;
|
||||
std::tie(Old, New) = Elem;
|
||||
|
|
|
@ -570,7 +570,7 @@ void XCOFFObjectWriter::writeSymbolTable(const MCAsmLayout &Layout) {
|
|||
writeSymbolTableEntryForControlSection(
|
||||
Csect, SectionIndex, Csect.MCCsect->getStorageClass());
|
||||
|
||||
for (const auto Sym : Csect.Syms)
|
||||
for (const auto &Sym : Csect.Syms)
|
||||
writeSymbolTableEntryForCsectMemberLabel(
|
||||
Sym, Csect, SectionIndex, Layout.getSymbolOffset(*(Sym.MCSym)));
|
||||
}
|
||||
|
|
|
@ -281,7 +281,7 @@ void ResourceManager::releaseBuffers(uint64_t ConsumedBuffers) {
|
|||
|
||||
uint64_t ResourceManager::checkAvailability(const InstrDesc &Desc) const {
|
||||
uint64_t BusyResourceMask = 0;
|
||||
for (const std::pair<uint64_t, const ResourceUsage> &E : Desc.Resources) {
|
||||
for (const std::pair<uint64_t, ResourceUsage> &E : Desc.Resources) {
|
||||
unsigned NumUnits = E.second.isReserved() ? 0U : E.second.NumUnits;
|
||||
unsigned Index = getResourceStateIndex(E.first);
|
||||
if (!Resources[Index]->isReady(NumUnits))
|
||||
|
|
|
@ -24,7 +24,8 @@ Error InstructionTables::execute(InstRef &IR) {
|
|||
UsedResources.clear();
|
||||
|
||||
// Identify the resources consumed by this instruction.
|
||||
for (const std::pair<uint64_t, ResourceUsage> Resource : Desc.Resources) {
|
||||
for (const std::pair<const uint64_t, ResourceUsage> Resource :
|
||||
Desc.Resources) {
|
||||
// Skip zero-cycle resources (i.e., unused resources).
|
||||
if (!Resource.second.size())
|
||||
continue;
|
||||
|
|
|
@ -421,7 +421,7 @@ std::shared_ptr<DebugSubsection> YAMLLinesSubsection::toCodeViewSubsection(
|
|||
for (const auto &LC : Lines.Blocks) {
|
||||
Result->createBlock(LC.FileName);
|
||||
if (Result->hasColumnInfo()) {
|
||||
for (const auto &Item : zip(LC.Lines, LC.Columns)) {
|
||||
for (auto Item : zip(LC.Lines, LC.Columns)) {
|
||||
auto &L = std::get<0>(Item);
|
||||
auto &C = std::get<1>(Item);
|
||||
uint32_t LE = L.LineStart + L.EndDelta;
|
||||
|
|
|
@ -187,7 +187,7 @@ public:
|
|||
// If we're adding this to all sub-commands, add it to the ones that have
|
||||
// already been registered.
|
||||
if (SC == &*AllSubCommands) {
|
||||
for (const auto &Sub : RegisteredSubCommands) {
|
||||
for (auto *Sub : RegisteredSubCommands) {
|
||||
if (SC == Sub)
|
||||
continue;
|
||||
addLiteralOption(Opt, Sub, Name);
|
||||
|
@ -243,7 +243,7 @@ public:
|
|||
// If we're adding this to all sub-commands, add it to the ones that have
|
||||
// already been registered.
|
||||
if (SC == &*AllSubCommands) {
|
||||
for (const auto &Sub : RegisteredSubCommands) {
|
||||
for (auto *Sub : RegisteredSubCommands) {
|
||||
if (SC == Sub)
|
||||
continue;
|
||||
addOption(O, Sub);
|
||||
|
@ -318,7 +318,7 @@ public:
|
|||
}
|
||||
|
||||
bool hasOptions() const {
|
||||
for (const auto &S : RegisteredSubCommands) {
|
||||
for (const auto *S : RegisteredSubCommands) {
|
||||
if (hasOptions(*S))
|
||||
return true;
|
||||
}
|
||||
|
@ -2112,7 +2112,7 @@ static void sortOpts(StringMap<Option *> &OptMap,
|
|||
static void
|
||||
sortSubCommands(const SmallPtrSetImpl<SubCommand *> &SubMap,
|
||||
SmallVectorImpl<std::pair<const char *, SubCommand *>> &Subs) {
|
||||
for (const auto &S : SubMap) {
|
||||
for (auto *S : SubMap) {
|
||||
if (S->getName().empty())
|
||||
continue;
|
||||
Subs.push_back(std::make_pair(S->getName().data(), S));
|
||||
|
|
|
@ -132,7 +132,7 @@ StringRef llvm::AMDGPU::getArchNameR600(GPUKind AK) {
|
|||
}
|
||||
|
||||
AMDGPU::GPUKind llvm::AMDGPU::parseArchAMDGCN(StringRef CPU) {
|
||||
for (const auto C : AMDGCNGPUs) {
|
||||
for (const auto &C : AMDGCNGPUs) {
|
||||
if (CPU == C.Name)
|
||||
return C.Kind;
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ AMDGPU::GPUKind llvm::AMDGPU::parseArchAMDGCN(StringRef CPU) {
|
|||
}
|
||||
|
||||
AMDGPU::GPUKind llvm::AMDGPU::parseArchR600(StringRef CPU) {
|
||||
for (const auto C : R600GPUs) {
|
||||
for (const auto &C : R600GPUs) {
|
||||
if (CPU == C.Name)
|
||||
return C.Kind;
|
||||
}
|
||||
|
@ -163,12 +163,12 @@ unsigned AMDGPU::getArchAttrR600(GPUKind AK) {
|
|||
|
||||
void AMDGPU::fillValidArchListAMDGCN(SmallVectorImpl<StringRef> &Values) {
|
||||
// XXX: Should this only report unique canonical names?
|
||||
for (const auto C : AMDGCNGPUs)
|
||||
for (const auto &C : AMDGCNGPUs)
|
||||
Values.push_back(C.Name);
|
||||
}
|
||||
|
||||
void AMDGPU::fillValidArchListR600(SmallVectorImpl<StringRef> &Values) {
|
||||
for (const auto C : R600GPUs)
|
||||
for (const auto &C : R600GPUs)
|
||||
Values.push_back(C.Name);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue