File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -130,20 +130,15 @@ class CyclicDependencyCallbacks : public PPCallbacks {
130130 << FileName;
131131
132132 const bool IsIncludePathValid =
133- std::all_of (Files.rbegin (), It, [](const Include &Elem) {
133+ std::all_of (Files.rbegin (), It + 1 , [](const Include &Elem) {
134134 return !Elem.Name .empty () && Elem.Loc .isValid ();
135135 });
136-
137136 if (!IsIncludePathValid)
138137 return ;
139138
140- auto CurrentIt = Files.rbegin ();
141- do {
142- if (CurrentIt->Loc .isValid ())
143- Check.diag (CurrentIt->Loc , " '%0' included from here" ,
144- DiagnosticIDs::Note)
145- << CurrentIt->Name ;
146- } while (CurrentIt++ != It);
139+ for (const Include &I : llvm::make_range (Files.rbegin (), It + 1 ))
140+ Check.diag (I.Loc , " '%0' included from here" , DiagnosticIDs::Note)
141+ << I.Name ;
147142 }
148143
149144 bool isFileIgnored (StringRef FileName) const {
You can’t perform that action at this time.
0 commit comments