diff options
author | Craig Topper <craig.topper@gmail.com> | 2014-04-15 06:32:26 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2014-04-15 06:32:26 +0000 |
commit | 2617dccea2721fd74677f0a7bcf5a768238421d0 (patch) | |
tree | ad5ee2efaff543d7da11f1599bdabb6588d1c1dd /llvm/lib/IR/Metadata.cpp | |
parent | d82d4cc3567e896fad35372adba9a676c7776cd0 (diff) | |
download | bcm5719-llvm-2617dccea2721fd74677f0a7bcf5a768238421d0.tar.gz bcm5719-llvm-2617dccea2721fd74677f0a7bcf5a768238421d0.zip |
[C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr.
llvm-svn: 206252
Diffstat (limited to 'llvm/lib/IR/Metadata.cpp')
-rw-r--r-- | llvm/lib/IR/Metadata.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp index 39acbd81066..4d932d03962 100644 --- a/llvm/lib/IR/Metadata.cpp +++ b/llvm/lib/IR/Metadata.cpp @@ -164,10 +164,10 @@ static const Function *getFunctionForValue(Value *V) { #ifndef NDEBUG static const Function *assertLocalFunction(const MDNode *N) { - if (!N->isFunctionLocal()) return 0; + if (!N->isFunctionLocal()) return nullptr; // FIXME: This does not handle cyclic function local metadata. - const Function *F = 0, *NewF = 0; + const Function *F = nullptr, *NewF = nullptr; for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) { if (Value *V = N->getOperand(i)) { if (MDNode *MD = dyn_cast<MDNode>(V)) @@ -175,10 +175,11 @@ static const Function *assertLocalFunction(const MDNode *N) { else NewF = getFunctionForValue(V); } - if (F == 0) + if (!F) F = NewF; - else - assert((NewF == 0 || F == NewF) &&"inconsistent function-local metadata"); + else + assert((NewF == nullptr || F == NewF) && + "inconsistent function-local metadata"); } return F; } |