[C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206243 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper
2014-04-15 04:59:12 +00:00
parent a8ae0ad11f
commit 570e52c6f1
59 changed files with 574 additions and 563 deletions

View File

@@ -48,13 +48,13 @@ public:
/// analysis and whether the visit completed or aborted early.
class PtrInfo {
public:
PtrInfo() : AbortedInfo(0, false), EscapedInfo(0, false) {}
PtrInfo() : AbortedInfo(nullptr, false), EscapedInfo(nullptr, false) {}
/// \brief Reset the pointer info, clearing all state.
void reset() {
AbortedInfo.setPointer(0);
AbortedInfo.setPointer(nullptr);
AbortedInfo.setInt(false);
EscapedInfo.setPointer(0);
EscapedInfo.setPointer(nullptr);
EscapedInfo.setInt(false);
}
@@ -76,14 +76,14 @@ public:
/// \brief Mark the visit as aborted. Intended for use in a void return.
/// \param I The instruction which caused the visit to abort, if available.
void setAborted(Instruction *I = 0) {
void setAborted(Instruction *I = nullptr) {
AbortedInfo.setInt(true);
AbortedInfo.setPointer(I);
}
/// \brief Mark the pointer as escaped. Intended for use in a void return.
/// \param I The instruction which escapes the pointer, if available.
void setEscaped(Instruction *I = 0) {
void setEscaped(Instruction *I = nullptr) {
EscapedInfo.setInt(true);
EscapedInfo.setPointer(I);
}
@@ -92,7 +92,7 @@ public:
/// for use in a void return.
/// \param I The instruction which both escapes the pointer and aborts the
/// visit, if available.
void setEscapedAndAborted(Instruction *I = 0) {
void setEscapedAndAborted(Instruction *I = nullptr) {
setEscaped(I);
setAborted(I);
}