mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-21 23:10:54 +00:00
Retire llvm::less_ptr. llvm::deref is much more flexible.
llvm-svn: 369675
This commit is contained in:
parent
d5aecb9486
commit
cd2bae3bd7
@ -2506,7 +2506,7 @@ void ASTWriter::WritePreprocessor(const Preprocessor &PP, bool IsModule) {
|
|||||||
MacroIdentifiers.push_back(Id.second);
|
MacroIdentifiers.push_back(Id.second);
|
||||||
// Sort the set of macro definitions that need to be serialized by the
|
// Sort the set of macro definitions that need to be serialized by the
|
||||||
// name of the macro, to provide a stable ordering.
|
// name of the macro, to provide a stable ordering.
|
||||||
llvm::sort(MacroIdentifiers, llvm::less_ptr<IdentifierInfo>());
|
llvm::sort(MacroIdentifiers, llvm::deref<std::less<>>());
|
||||||
|
|
||||||
// Emit the macro directives as a list and associate the offset with the
|
// Emit the macro directives as a list and associate the offset with the
|
||||||
// identifier they belong to.
|
// identifier they belong to.
|
||||||
@ -3748,7 +3748,7 @@ void ASTWriter::WriteIdentifierTable(Preprocessor &PP,
|
|||||||
IIs.push_back(ID.second);
|
IIs.push_back(ID.second);
|
||||||
// Sort the identifiers lexicographically before getting them references so
|
// Sort the identifiers lexicographically before getting them references so
|
||||||
// that their order is stable.
|
// that their order is stable.
|
||||||
llvm::sort(IIs, llvm::less_ptr<IdentifierInfo>());
|
llvm::sort(IIs, llvm::deref<std::less<>>());
|
||||||
for (const IdentifierInfo *II : IIs)
|
for (const IdentifierInfo *II : IIs)
|
||||||
if (Trait.isInterestingNonMacroIdentifier(II))
|
if (Trait.isInterestingNonMacroIdentifier(II))
|
||||||
getIdentifierRef(II);
|
getIdentifierRef(II);
|
||||||
@ -4924,7 +4924,7 @@ ASTFileSignature ASTWriter::WriteASTCore(Sema &SemaRef, StringRef isysroot,
|
|||||||
IIs.push_back(II);
|
IIs.push_back(II);
|
||||||
}
|
}
|
||||||
// Sort the identifiers to visit based on their name.
|
// Sort the identifiers to visit based on their name.
|
||||||
llvm::sort(IIs, llvm::less_ptr<IdentifierInfo>());
|
llvm::sort(IIs, llvm::deref<std::less<>>());
|
||||||
for (const IdentifierInfo *II : IIs) {
|
for (const IdentifierInfo *II : IIs) {
|
||||||
for (IdentifierResolver::iterator D = SemaRef.IdResolver.begin(II),
|
for (IdentifierResolver::iterator D = SemaRef.IdResolver.begin(II),
|
||||||
DEnd = SemaRef.IdResolver.end();
|
DEnd = SemaRef.IdResolver.end();
|
||||||
|
@ -2456,7 +2456,7 @@ void NeonEmitter::run(raw_ostream &OS) {
|
|||||||
for (auto *I : Defs)
|
for (auto *I : Defs)
|
||||||
I->indexBody();
|
I->indexBody();
|
||||||
|
|
||||||
llvm::stable_sort(Defs, llvm::less_ptr<Intrinsic>());
|
llvm::stable_sort(Defs, llvm::deref<std::less<>>());
|
||||||
|
|
||||||
// Only emit a def when its requirements have been met.
|
// Only emit a def when its requirements have been met.
|
||||||
// FIXME: This loop could be made faster, but it's fast enough for now.
|
// FIXME: This loop could be made faster, but it's fast enough for now.
|
||||||
@ -2563,7 +2563,7 @@ void NeonEmitter::runFP16(raw_ostream &OS) {
|
|||||||
for (auto *I : Defs)
|
for (auto *I : Defs)
|
||||||
I->indexBody();
|
I->indexBody();
|
||||||
|
|
||||||
llvm::stable_sort(Defs, llvm::less_ptr<Intrinsic>());
|
llvm::stable_sort(Defs, llvm::deref<std::less<>>());
|
||||||
|
|
||||||
// Only emit a def when its requirements have been met.
|
// Only emit a def when its requirements have been met.
|
||||||
// FIXME: This loop could be made faster, but it's fast enough for now.
|
// FIXME: This loop could be made faster, but it's fast enough for now.
|
||||||
|
@ -95,18 +95,6 @@ template <class Ty> struct identity {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class Ty> struct less_ptr {
|
|
||||||
bool operator()(const Ty* left, const Ty* right) const {
|
|
||||||
return *left < *right;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class Ty> struct greater_ptr {
|
|
||||||
bool operator()(const Ty* left, const Ty* right) const {
|
|
||||||
return *right < *left;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/// An efficient, type-erasing, non-owning reference to a callable. This is
|
/// An efficient, type-erasing, non-owning reference to a callable. This is
|
||||||
/// intended for use as the type of a function parameter that is not used
|
/// intended for use as the type of a function parameter that is not used
|
||||||
/// after the function in question returns.
|
/// after the function in question returns.
|
||||||
|
@ -1439,7 +1439,7 @@ void AsmMatcherInfo::buildOperandMatchInfo() {
|
|||||||
|
|
||||||
/// Map containing a mask with all operands indices that can be found for
|
/// Map containing a mask with all operands indices that can be found for
|
||||||
/// that class inside a instruction.
|
/// that class inside a instruction.
|
||||||
typedef std::map<ClassInfo *, unsigned, less_ptr<ClassInfo>> OpClassMaskTy;
|
typedef std::map<ClassInfo *, unsigned, deref<std::less<>>> OpClassMaskTy;
|
||||||
OpClassMaskTy OpClassMask;
|
OpClassMaskTy OpClassMask;
|
||||||
|
|
||||||
for (const auto &MI : Matchables) {
|
for (const auto &MI : Matchables) {
|
||||||
|
Loading…
Reference in New Issue
Block a user