summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveInterval.cpp
diff options
context:
space:
mode:
authorEugene Zelenko <eugene.zelenko@gmail.com>2017-08-24 21:21:39 +0000
committerEugene Zelenko <eugene.zelenko@gmail.com>2017-08-24 21:21:39 +0000
commit5df3d89009536306ef278a123feadc9ea0760a85 (patch)
treeea21a3b9a37204a53ef145030eed4f91e51b87cf /llvm/lib/CodeGen/LiveInterval.cpp
parentf98335e0b08868c05a91349edf9c60a2b014686c (diff)
downloadbcm5719-llvm-5df3d89009536306ef278a123feadc9ea0760a85.tar.gz
bcm5719-llvm-5df3d89009536306ef278a123feadc9ea0760a85.zip
[CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 311703
Diffstat (limited to 'llvm/lib/CodeGen/LiveInterval.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveInterval.cpp46
1 files changed, 30 insertions, 16 deletions
diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp
index 9ef9f238fdc..ac19d7b0139 100644
--- a/llvm/lib/CodeGen/LiveInterval.cpp
+++ b/llvm/lib/CodeGen/LiveInterval.cpp
@@ -1,4 +1,4 @@
-//===-- LiveInterval.cpp - Live Interval Representation -------------------===//
+//===- LiveInterval.cpp - Live Interval Representation --------------------===//
//
// The LLVM Compiler Infrastructure
//
@@ -19,20 +19,34 @@
//===----------------------------------------------------------------------===//
#include "llvm/CodeGen/LiveInterval.h"
-
#include "LiveRangeUtils.h"
#include "RegisterCoalescer.h"
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/SmallSet.h"
+#include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/iterator_range.h"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
+#include "llvm/CodeGen/MachineBasicBlock.h"
+#include "llvm/CodeGen/MachineInstr.h"
+#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
+#include "llvm/CodeGen/SlotIndexes.h"
+#include "llvm/MC/LaneBitmask.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include <algorithm>
+#include <cassert>
+#include <cstddef>
+#include <iterator>
+#include <utility>
+
using namespace llvm;
namespace {
+
//===----------------------------------------------------------------------===//
// Implementation of various methods necessary for calculation of live ranges.
// The implementation of the methods abstracts from the concrete type of the
@@ -56,8 +70,8 @@ protected:
CalcLiveRangeUtilBase(LiveRange *LR) : LR(LR) {}
public:
- typedef LiveRange::Segment Segment;
- typedef IteratorT iterator;
+ using Segment = LiveRange::Segment;
+ using iterator = IteratorT;
/// A counterpart of LiveRange::createDeadDef: Make sure the range has a
/// value defined at @p Def.
@@ -265,8 +279,9 @@ private:
//===----------------------------------------------------------------------===//
class CalcLiveRangeUtilVector;
-typedef CalcLiveRangeUtilBase<CalcLiveRangeUtilVector, LiveRange::iterator,
- LiveRange::Segments> CalcLiveRangeUtilVectorBase;
+using CalcLiveRangeUtilVectorBase =
+ CalcLiveRangeUtilBase<CalcLiveRangeUtilVector, LiveRange::iterator,
+ LiveRange::Segments>;
class CalcLiveRangeUtilVector : public CalcLiveRangeUtilVectorBase {
public:
@@ -292,9 +307,9 @@ private:
//===----------------------------------------------------------------------===//
class CalcLiveRangeUtilSet;
-typedef CalcLiveRangeUtilBase<CalcLiveRangeUtilSet,
- LiveRange::SegmentSet::iterator,
- LiveRange::SegmentSet> CalcLiveRangeUtilSetBase;
+using CalcLiveRangeUtilSetBase =
+ CalcLiveRangeUtilBase<CalcLiveRangeUtilSet, LiveRange::SegmentSet::iterator,
+ LiveRange::SegmentSet>;
class CalcLiveRangeUtilSet : public CalcLiveRangeUtilSetBase {
public:
@@ -327,7 +342,8 @@ private:
return I;
}
};
-} // namespace
+
+} // end anonymous namespace
//===----------------------------------------------------------------------===//
// LiveRange methods
@@ -444,7 +460,7 @@ bool LiveRange::overlaps(const LiveRange &Other, const CoalescerPair &CP,
if (J == JE)
return false;
- for (;;) {
+ while (true) {
// J has just been advanced to satisfy:
assert(J->end >= I->start);
// Check for an overlap.
@@ -865,7 +881,6 @@ void LiveInterval::clearSubRanges() {
void LiveInterval::refineSubRanges(BumpPtrAllocator &Allocator,
LaneBitmask LaneMask, std::function<void(LiveInterval::SubRange&)> Apply) {
-
LaneBitmask ToApply = LaneMask;
for (SubRange &SR : subranges()) {
LaneBitmask SRMask = SR.LaneMask;
@@ -925,8 +940,8 @@ void LiveInterval::computeSubRangeUndefs(SmallVectorImpl<SlotIndex> &Undefs,
}
}
-raw_ostream& llvm::operator<<(raw_ostream& os, const LiveRange::Segment &S) {
- return os << '[' << S.start << ',' << S.end << ':' << S.valno->id << ')';
+raw_ostream& llvm::operator<<(raw_ostream& OS, const LiveRange::Segment &S) {
+ return OS << '[' << S.start << ',' << S.end << ':' << S.valno->id << ')';
}
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
@@ -1033,7 +1048,6 @@ void LiveInterval::verify(const MachineRegisterInfo *MRI) const {
}
#endif
-
//===----------------------------------------------------------------------===//
// LiveRangeUpdater class
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud