}
llvm::iterator_range<reverse_iterator> reverse() {
- return llvm::make_range(rbegin(), rend());
+ return llvm::reverse(*this);
}
llvm::iterator_range<const_reverse_iterator> reverse() const {
- return llvm::make_range(rbegin(), rend());
+ return llvm::reverse(*this);
}
private:
using arg_reverse_iterator =
SmallVectorImpl<PrimType>::const_reverse_iterator;
llvm::iterator_range<arg_reverse_iterator> args_reverse() const {
- return llvm::make_range(ParamTypes.rbegin(), ParamTypes.rend());
+ return llvm::reverse(ParamTypes);
}
/// Returns a specific scope.
void AddUnalignedAccessWarning(ArgStringList &CmdArgs) {
auto StrictAlignIter =
- std::find_if(CmdArgs.rbegin(), CmdArgs.rend(), [](StringRef Arg) {
+ llvm::find_if(llvm::reverse(CmdArgs), [](StringRef Arg) {
return Arg == "+strict-align" || Arg == "-strict-align";
});
if (StrictAlignIter != CmdArgs.rend() &&
if (getAnalyzerOptions().ShouldDisplayNotesAsEvents) {
// For path diagnostic consumers that don't support extra notes,
// we may optionally convert those to path notes.
- for (auto I = report->getNotes().rbegin(),
- E = report->getNotes().rend(); I != E; ++I) {
- PathDiagnosticNotePiece *Piece = I->get();
+ for (const auto &I : llvm::reverse(report->getNotes())) {
+ PathDiagnosticNotePiece *Piece = I.get();
auto ConvertedPiece = std::make_shared<PathDiagnosticEventPiece>(
Piece->getLocation(), Piece->getString());
for (const auto &R: Piece->getRanges())
Pieces.push_front(std::move(ConvertedPiece));
}
} else {
- for (auto I = report->getNotes().rbegin(),
- E = report->getNotes().rend(); I != E; ++I)
- Pieces.push_front(*I);
+ for (const auto &I : llvm::reverse(report->getNotes()))
+ Pieces.push_front(I);
}
for (const auto &I : report->getFixits())