Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: src/IceRegAlloc.cpp

Issue 1284493003: Subzero: Misc fixes/cleanup. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceInstARM32.cpp ('k') | src/IceTargetLoweringX86BaseImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceRegAlloc.cpp
diff --git a/src/IceRegAlloc.cpp b/src/IceRegAlloc.cpp
index d0dc3fb1adb25331ef4479e6117a08a2cf2736ef..0d9afba44d55c72f68d4bab6ac184380781bf21b 100644
--- a/src/IceRegAlloc.cpp
+++ b/src/IceRegAlloc.cpp
@@ -249,19 +249,17 @@ void LinearScan::init(RegAllocKind Kind) {
break;
}
- struct CompareRanges {
- bool operator()(const Variable *L, const Variable *R) {
+ auto CompareRanges = [](const Variable *L, const Variable *R) {
InstNumberT Lstart = L->getLiveRange().getStart();
InstNumberT Rstart = R->getLiveRange().getStart();
if (Lstart == Rstart)
return L->getIndex() < R->getIndex();
return Lstart < Rstart;
- }
};
// Do a reverse sort so that erasing elements (from the end) is fast.
- std::sort(Unhandled.rbegin(), Unhandled.rend(), CompareRanges());
+ std::sort(Unhandled.rbegin(), Unhandled.rend(), CompareRanges);
std::sort(UnhandledPrecolored.rbegin(), UnhandledPrecolored.rend(),
- CompareRanges());
+ CompareRanges);
Handled.reserve(Unhandled.size());
Inactive.reserve(Unhandled.size());
« no previous file with comments | « src/IceInstARM32.cpp ('k') | src/IceTargetLoweringX86BaseImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698