summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SlotIndexes.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2014-04-14 00:51:57 +0000
committerCraig Topper <craig.topper@gmail.com>2014-04-14 00:51:57 +0000
commitc0196b1b4094aeb27fd91466e0c4c1185a492daa (patch)
tree3a3d0ad3aebec28bee34ab7808fee8e75e567eb8 /llvm/lib/CodeGen/SlotIndexes.cpp
parent0192cbac6669fb9fff8cf9a75d53757a494af9ca (diff)
downloadbcm5719-llvm-c0196b1b4094aeb27fd91466e0c4c1185a492daa.tar.gz
bcm5719-llvm-c0196b1b4094aeb27fd91466e0c4c1185a492daa.zip
[C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr.
llvm-svn: 206142
Diffstat (limited to 'llvm/lib/CodeGen/SlotIndexes.cpp')
-rw-r--r--llvm/lib/CodeGen/SlotIndexes.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SlotIndexes.cpp b/llvm/lib/CodeGen/SlotIndexes.cpp
index a6c62617efa..c4f3aec3d0e 100644
--- a/llvm/lib/CodeGen/SlotIndexes.cpp
+++ b/llvm/lib/CodeGen/SlotIndexes.cpp
@@ -66,7 +66,7 @@ bool SlotIndexes::runOnMachineFunction(MachineFunction &fn) {
MBBRanges.resize(mf->getNumBlockIDs());
idx2MBBMap.reserve(mf->size());
- indexList.push_back(createEntry(0, index));
+ indexList.push_back(createEntry(nullptr, index));
// Iterate over the function.
for (MachineFunction::iterator mbbItr = mf->begin(), mbbEnd = mf->end();
@@ -91,7 +91,7 @@ bool SlotIndexes::runOnMachineFunction(MachineFunction &fn) {
}
// We insert one blank instructions between basic blocks.
- indexList.push_back(createEntry(0, index += SlotIndex::InstrDist));
+ indexList.push_back(createEntry(nullptr, index += SlotIndex::InstrDist));
MBBRanges[mbb->getNumber()].first = blockStartIndex;
MBBRanges[mbb->getNumber()].second = SlotIndex(&indexList.back(),
@@ -182,7 +182,7 @@ void SlotIndexes::repairIndexesInRange(MachineBasicBlock *MBB,
"Decremented past the beginning of region to repair.");
MachineInstr *SlotMI = ListI->getInstr();
- MachineInstr *MI = (MBBI != MBB->end() && !pastStart) ? MBBI : 0;
+ MachineInstr *MI = (MBBI != MBB->end() && !pastStart) ? MBBI : nullptr;
bool MBBIAtBegin = MBBI == Begin && (!includeStart || pastStart);
if (SlotMI == MI && !MBBIAtBegin) {
@@ -219,7 +219,7 @@ void SlotIndexes::dump() const {
itr != indexList.end(); ++itr) {
dbgs() << itr->getIndex() << " ";
- if (itr->getInstr() != 0) {
+ if (itr->getInstr()) {
dbgs() << *itr->getInstr();
} else {
dbgs() << "\n";
OpenPOWER on IntegriCloud