summaryrefslogtreecommitdiff
path: root/utils/TableGen/CodeGenRegisters.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/TableGen/CodeGenRegisters.h')
-rw-r--r--utils/TableGen/CodeGenRegisters.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/utils/TableGen/CodeGenRegisters.h b/utils/TableGen/CodeGenRegisters.h
index 03ffb43a12..30732c8e04 100644
--- a/utils/TableGen/CodeGenRegisters.h
+++ b/utils/TableGen/CodeGenRegisters.h
@@ -71,7 +71,7 @@ namespace llvm {
// Returns NULL if this and Idx don't compose.
CodeGenSubRegIndex *compose(CodeGenSubRegIndex *Idx) const {
CompMap::const_iterator I = Composed.find(Idx);
- return I == Composed.end() ? 0 : I->second;
+ return I == Composed.end() ? nullptr : I->second;
}
// Add a composite subreg index: this+A = B.
@@ -90,7 +90,8 @@ namespace llvm {
B->Offset = Offset + A->Offset;
B->Size = A->Size;
}
- return (Ins.second || Ins.first->second == B) ? 0 : Ins.first->second;
+ return (Ins.second || Ins.first->second == B) ? nullptr
+ : Ins.first->second;
}
// Update the composite maps of components specified in 'ComposedOf'.
@@ -414,7 +415,9 @@ namespace llvm {
// contain this unit.
unsigned RegClassUnitSetsIdx;
- RegUnit() : Weight(0), RegClassUnitSetsIdx(0) { Roots[0] = Roots[1] = 0; }
+ RegUnit() : Weight(0), RegClassUnitSetsIdx(0) {
+ Roots[0] = Roots[1] = nullptr;
+ }
ArrayRef<const CodeGenRegister*> getRoots() const {
assert(!(Roots[1] && !Roots[0]) && "Invalid roots array");
@@ -572,7 +575,7 @@ namespace llvm {
// Create a native register unit that is associated with one or two root
// registers.
- unsigned newRegUnit(CodeGenRegister *R0, CodeGenRegister *R1 = 0) {
+ unsigned newRegUnit(CodeGenRegister *R0, CodeGenRegister *R1 = nullptr) {
RegUnits.resize(RegUnits.size() + 1);
RegUnits.back().Roots[0] = R0;
RegUnits.back().Roots[1] = R1;