Subzero: Clean up a few areas.
1. Use a reverse_range() adaptor for range-based reverse iteration through containers.
2. Remove the emitting of the commented llvm-mc command line.
3. Remove a few TODOs.
4. For commented-out declarations within a class T like this:
// T(const T&) = delete;
// T &operator=(const T &) = delete;
Replace them with this:
T(const T&) = default;
T &operator=(const T &) = default;
And try to keep them private where possible.
5. Make LivenessNode and TimerTreeNode into internal classes.
BUG= none
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/830303003
diff --git a/src/IceTimerTree.cpp b/src/IceTimerTree.cpp
index 9f2340d..2c912e4 100644
--- a/src/IceTimerTree.cpp
+++ b/src/IceTimerTree.cpp
@@ -141,12 +141,11 @@
void dumpHelper(Ostream &Str, const DumpMapType &Map, double TotalTime) {
if (!ALLOW_DUMP)
return;
- // TODO(stichnot): Use llvm::make_range with LLVM 3.5.
- for (auto I = Map.rbegin(), E = Map.rend(); I != E; ++I) {
+ for (auto &I : reverse_range(Map)) {
char buf[80];
- snprintf(buf, llvm::array_lengthof(buf), " %10.6f (%4.1f%%): ", I->first,
- I->first * 100 / TotalTime);
- Str << buf << I->second << "\n";
+ snprintf(buf, llvm::array_lengthof(buf), " %10.6f (%4.1f%%): ", I.first,
+ I.first * 100 / TotalTime);
+ Str << buf << I.second << "\n";
}
}