Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions clang/lib/APINotes/APINotesWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,13 +446,13 @@ void emitVersionedInfo(
llvm::function_ref<void(raw_ostream &,
const typename MakeDependent<T>::Type &)>
emitInfo) {
std::sort(VI.begin(), VI.end(),
[](const std::pair<VersionTuple, T> &LHS,
const std::pair<VersionTuple, T> &RHS) -> bool {
assert((&LHS == &RHS || LHS.first != RHS.first) &&
"two entries for the same version");
return LHS.first < RHS.first;
});
llvm::sort(VI,
[](const std::pair<VersionTuple, T> &LHS,
const std::pair<VersionTuple, T> &RHS) -> bool {
assert((&LHS == &RHS || LHS.first != RHS.first) &&
"two entries for the same version");
return LHS.first < RHS.first;
});

llvm::support::endian::Writer writer(OS, llvm::endianness::little);
writer.write<uint16_t>(VI.size());
Expand Down
6 changes: 3 additions & 3 deletions clang/lib/Analysis/FlowSensitive/SimplifyConstraints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ void simplifyConstraints(llvm::SetVector<const Formula *> &Constraints,
atomsInEquivalenceClass(EquivalentAtoms, At);
if (Atoms.size() == 1)
continue;
std::sort(Atoms.begin(), Atoms.end());
llvm::sort(Atoms);
Info->EquivalentAtoms.push_back(std::move(Atoms));
}
for (Atom At : TrueAtoms)
Info->TrueAtoms.append(atomsInEquivalenceClass(EquivalentAtoms, At));
std::sort(Info->TrueAtoms.begin(), Info->TrueAtoms.end());
llvm::sort(Info->TrueAtoms);
for (Atom At : FalseAtoms)
Info->FalseAtoms.append(atomsInEquivalenceClass(EquivalentAtoms, At));
std::sort(Info->FalseAtoms.begin(), Info->FalseAtoms.end());
llvm::sort(Info->FalseAtoms);
}
}

Expand Down
9 changes: 4 additions & 5 deletions clang/lib/Analysis/UnsafeBufferUsage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2622,11 +2622,10 @@ bool clang::internal::anyConflict(const SmallVectorImpl<FixItHint> &FixIts,

for (const FixItHint &H : FixIts)
All.push_back(&H);
std::sort(All.begin(), All.end(),
[&SM](const FixItHint *H1, const FixItHint *H2) {
return SM.isBeforeInTranslationUnit(H1->RemoveRange.getBegin(),
H2->RemoveRange.getBegin());
});
llvm::sort(All, [&SM](const FixItHint *H1, const FixItHint *H2) {
return SM.isBeforeInTranslationUnit(H1->RemoveRange.getBegin(),
H2->RemoveRange.getBegin());
});

const FixItHint *CurrHint = nullptr;

Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Driver/ToolChain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ ToolChain::getMultilibFlags(const llvm::opt::ArgList &Args) const {
Result.push_back("-fexceptions");

// Sort and remove duplicates.
std::sort(Result.begin(), Result.end());
llvm::sort(Result);
Result.erase(llvm::unique(Result), Result.end());
return Result;
}
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Interpreter/CodeCompletion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ void ReplCompletionConsumer::ProcessCodeCompleteResults(
}
}

std::sort(Results.begin(), Results.end());
llvm::sort(Results);
}

class IncrementalSyntaxOnlyAction : public SyntaxOnlyAction {
Expand Down
11 changes: 5 additions & 6 deletions clang/lib/Sema/SemaHLSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,11 @@ static void validatePackoffset(Sema &S, HLSLBufferDecl *BufDecl) {
// and compare adjacent values.
bool IsValid = true;
ASTContext &Context = S.getASTContext();
std::sort(PackOffsetVec.begin(), PackOffsetVec.end(),
[](const std::pair<VarDecl *, HLSLPackOffsetAttr *> &LHS,
const std::pair<VarDecl *, HLSLPackOffsetAttr *> &RHS) {
return LHS.second->getOffsetInBytes() <
RHS.second->getOffsetInBytes();
});
llvm::sort(
PackOffsetVec, [](const std::pair<VarDecl *, HLSLPackOffsetAttr *> &LHS,
const std::pair<VarDecl *, HLSLPackOffsetAttr *> &RHS) {
return LHS.second->getOffsetInBytes() < RHS.second->getOffsetInBytes();
});
for (unsigned i = 0; i < PackOffsetVec.size() - 1; i++) {
VarDecl *Var = PackOffsetVec[i].first;
HLSLPackOffsetAttr *Attr = PackOffsetVec[i].second;
Expand Down
Loading