diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 10:51:19 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 10:51:19 +0000 |
commit | eb11fae6d08f479c0799db45860a98af528fa6e7 (patch) | |
tree | 44d492a50c8c1a7eb8e2d17ea3360ec4d066f042 /lib/Bitcode/Writer/ValueEnumerator.cpp | |
parent | b8a2042aa938069e862750553db0e4d82d25822c (diff) |
Notes
Diffstat (limited to 'lib/Bitcode/Writer/ValueEnumerator.cpp')
-rw-r--r-- | lib/Bitcode/Writer/ValueEnumerator.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Bitcode/Writer/ValueEnumerator.cpp b/lib/Bitcode/Writer/ValueEnumerator.cpp index d99befcdaeae..d473741e8ceb 100644 --- a/lib/Bitcode/Writer/ValueEnumerator.cpp +++ b/lib/Bitcode/Writer/ValueEnumerator.cpp @@ -14,6 +14,7 @@ #include "ValueEnumerator.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/Config/llvm-config.h" #include "llvm/IR/Argument.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/BasicBlock.h" @@ -183,7 +184,7 @@ static void predictValueUseListOrderImpl(const Value *V, const Function *F, return; bool IsGlobalValue = OM.isGlobalValue(ID); - std::sort(List.begin(), List.end(), [&](const Entry &L, const Entry &R) { + llvm::sort(List.begin(), List.end(), [&](const Entry &L, const Entry &R) { const Use *LU = L.first; const Use *RU = R.first; if (LU == RU) @@ -488,7 +489,7 @@ void ValueEnumerator::print(raw_ostream &OS, const ValueMapType &Map, V->print(errs()); errs() << '\n'; - OS << " Uses(" << std::distance(V->use_begin(),V->use_end()) << "):"; + OS << " Uses(" << V->getNumUses() << "):"; for (const Use &U : V->uses()) { if (&U != &*V->use_begin()) OS << ","; @@ -744,7 +745,7 @@ void ValueEnumerator::organizeMetadata() { // and then sort by the original/current ID. Since the IDs are guaranteed to // be unique, the result of std::sort will be deterministic. There's no need // for std::stable_sort. - std::sort(Order.begin(), Order.end(), [this](MDIndex LHS, MDIndex RHS) { + llvm::sort(Order.begin(), Order.end(), [this](MDIndex LHS, MDIndex RHS) { return std::make_tuple(LHS.F, getMetadataTypeOrder(LHS.get(MDs)), LHS.ID) < std::make_tuple(RHS.F, getMetadataTypeOrder(RHS.get(MDs)), RHS.ID); }); |