aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2014-04-09 06:08:46 +0000
committerCraig Topper <craig.topper@gmail.com>2014-04-09 06:08:46 +0000
commitc620761ca54a3076b28202c97e4702c2213419bd (patch)
tree1f38d9e163a7e7be2e67c946458cfcdf7dc464d0 /llvm/lib/IR/Attributes.cpp
parent011817a0bf35b17fafa1ba7500511ec3468250ca (diff)
downloadllvm-c620761ca54a3076b28202c97e4702c2213419bd.zip
llvm-c620761ca54a3076b28202c97e4702c2213419bd.tar.gz
llvm-c620761ca54a3076b28202c97e4702c2213419bd.tar.bz2
[C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr.
llvm-svn: 205831
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r--llvm/lib/IR/Attributes.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index 9d9d948..65bdc75 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -402,7 +402,7 @@ uint64_t AttributeImpl::getAttrMask(Attribute::AttrKind Val) {
AttributeSetNode *AttributeSetNode::get(LLVMContext &C,
ArrayRef<Attribute> Attrs) {
if (Attrs.empty())
- return 0;
+ return nullptr;
// Otherwise, build a key to look up the existing attributes.
LLVMContextImpl *pImpl = C.pImpl;
@@ -836,7 +836,7 @@ bool AttributeSet::hasAttributes(unsigned Index) const {
/// \brief Return true if the specified attribute is set for at least one
/// parameter or for the return value.
bool AttributeSet::hasAttrSomewhere(Attribute::AttrKind Attr) const {
- if (pImpl == 0) return false;
+ if (!pImpl) return false;
for (unsigned I = 0, E = pImpl->getNumAttributes(); I != E; ++I)
for (AttributeSetImpl::iterator II = pImpl->begin(I),
@@ -877,14 +877,14 @@ std::string AttributeSet::getAsString(unsigned Index,
/// \brief The attributes for the specified index are returned.
AttributeSetNode *AttributeSet::getAttributes(unsigned Index) const {
- if (!pImpl) return 0;
+ if (!pImpl) return nullptr;
// Loop through to find the attribute node we want.
for (unsigned I = 0, E = pImpl->getNumAttributes(); I != E; ++I)
if (pImpl->getSlotIndex(I) == Index)
return pImpl->getSlotNode(I);
- return 0;
+ return nullptr;
}
AttributeSet::iterator AttributeSet::begin(unsigned Slot) const {