summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Hexagon/HexagonBlockRanges.h
diff options
context:
space:
mode:
authorEugene Zelenko <eugene.zelenko@gmail.com>2017-07-26 23:20:35 +0000
committerEugene Zelenko <eugene.zelenko@gmail.com>2017-07-26 23:20:35 +0000
commite4fc6ee790009a1486af2ec1c0ee4f55d1ef6a26 (patch)
tree671c1eb69f6a406a0a30ede46e652989f166f8b6 /llvm/lib/Target/Hexagon/HexagonBlockRanges.h
parent08e38d6b3d89bd04a41c1a0518ef8e7217a72b38 (diff)
downloadbcm5719-llvm-e4fc6ee790009a1486af2ec1c0ee4f55d1ef6a26.tar.gz
bcm5719-llvm-e4fc6ee790009a1486af2ec1c0ee4f55d1ef6a26.zip
[Hexagon] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 309230
Diffstat (limited to 'llvm/lib/Target/Hexagon/HexagonBlockRanges.h')
-rw-r--r--llvm/lib/Target/Hexagon/HexagonBlockRanges.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonBlockRanges.h b/llvm/lib/Target/Hexagon/HexagonBlockRanges.h
index 769ec7044a0..131ff0f0e18 100644
--- a/llvm/lib/Target/Hexagon/HexagonBlockRanges.h
+++ b/llvm/lib/Target/Hexagon/HexagonBlockRanges.h
@@ -1,4 +1,4 @@
-//===--- HexagonBlockRanges.h -----------------------------------*- C++ -*-===//
+//===- HexagonBlockRanges.h -------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -10,7 +10,6 @@
#define HEXAGON_BLOCK_RANGES_H
#include "llvm/ADT/BitVector.h"
-#include "llvm/CodeGen/MachineBasicBlock.h"
#include <cassert>
#include <map>
#include <set>
@@ -23,6 +22,7 @@ class HexagonSubtarget;
class MachineBasicBlock;
class MachineFunction;
class MachineInstr;
+class MachineRegisterInfo;
class raw_ostream;
class TargetInstrInfo;
class TargetRegisterInfo;
@@ -32,11 +32,12 @@ struct HexagonBlockRanges {
struct RegisterRef {
unsigned Reg, Sub;
+
bool operator<(RegisterRef R) const {
return Reg < R.Reg || (Reg == R.Reg && Sub < R.Sub);
}
};
- typedef std::set<RegisterRef> RegisterSet;
+ using RegisterSet = std::set<RegisterRef>;
// This is to represent an "index", which is an abstraction of a position
// of an instruction within a basic block.
@@ -49,7 +50,7 @@ struct HexagonBlockRanges {
First = 11 // 10th + 1st
};
- IndexType() : Index(None) {}
+ IndexType() = default;
IndexType(unsigned Idx) : Index(Idx) {}
static bool isInstr(IndexType X) { return X.Index >= First; }
@@ -68,13 +69,13 @@ struct HexagonBlockRanges {
bool operator> (IndexType Idx) const;
bool operator>= (IndexType Idx) const;
- unsigned Index;
+ unsigned Index = None;
};
// A range of indices, essentially a representation of a live range.
// This is also used to represent "dead ranges", i.e. ranges where a
// register is dead.
- class IndexRange : public std::pair<IndexType,IndexType> {
+ class IndexRange : public std::pair<IndexType, IndexType> {
public:
IndexRange() = default;
IndexRange(IndexType Start, IndexType End, bool F = false, bool T = false)
@@ -138,7 +139,8 @@ struct HexagonBlockRanges {
std::map<IndexType,MachineInstr*> Map;
};
- typedef std::map<RegisterRef,RangeList> RegToRangeMap;
+ using RegToRangeMap = std::map<RegisterRef, RangeList>;
+
RegToRangeMap computeLiveMap(InstrIndexMap &IndexMap);
RegToRangeMap computeDeadMap(InstrIndexMap &IndexMap, RegToRangeMap &LiveMap);
static RegisterSet expandToSubRegs(RegisterRef R,
OpenPOWER on IntegriCloud