summaryrefslogtreecommitdiff
path: root/include/llvm/Support
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2014-04-13 04:57:38 +0000
committerCraig Topper <craig.topper@gmail.com>2014-04-13 04:57:38 +0000
commit4266ae806798f1e8982a53bb9babe1e508adfc68 (patch)
treed0a8021366191c2884dc07bfe73a2daee0b417c1 /include/llvm/Support
parent4e510c10b5310cffe6c27fb49c7f7d170dc73639 (diff)
downloadllvm-4266ae806798f1e8982a53bb9babe1e508adfc68.tar.gz
llvm-4266ae806798f1e8982a53bb9babe1e508adfc68.tar.bz2
llvm-4266ae806798f1e8982a53bb9babe1e508adfc68.tar.xz
[C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206129 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support')
-rw-r--r--include/llvm/Support/YAMLParser.h2
-rw-r--r--include/llvm/Support/YAMLTraits.h9
2 files changed, 6 insertions, 5 deletions
diff --git a/include/llvm/Support/YAMLParser.h b/include/llvm/Support/YAMLParser.h
index d9d632e00e..c5186a5cf6 100644
--- a/include/llvm/Support/YAMLParser.h
+++ b/include/llvm/Support/YAMLParser.h
@@ -541,7 +541,7 @@ public:
}
document_iterator operator ++() {
- assert(Doc != 0 && "incrementing iterator past the end.");
+ assert(Doc && "incrementing iterator past the end.");
if (!(*Doc)->skip()) {
Doc->reset(nullptr);
} else {
diff --git a/include/llvm/Support/YAMLTraits.h b/include/llvm/Support/YAMLTraits.h
index 50ab886c98..97ac0cdf9f 100644
--- a/include/llvm/Support/YAMLTraits.h
+++ b/include/llvm/Support/YAMLTraits.h
@@ -176,7 +176,8 @@ struct has_ScalarEnumerationTraits
static double test(...);
public:
- static bool const value = (sizeof(test<ScalarEnumerationTraits<T> >(0)) == 1);
+ static bool const value =
+ (sizeof(test<ScalarEnumerationTraits<T> >(nullptr)) == 1);
};
@@ -232,7 +233,7 @@ struct has_MappingTraits
static double test(...);
public:
- static bool const value = (sizeof(test<MappingTraits<T> >(0)) == 1);
+ static bool const value = (sizeof(test<MappingTraits<T> >(nullptr)) == 1);
};
// Test if MappingTraits<T>::validate() is defined on type T.
@@ -266,7 +267,7 @@ struct has_SequenceMethodTraits
static double test(...);
public:
- static bool const value = (sizeof(test<SequenceTraits<T> >(0)) == 1);
+ static bool const value = (sizeof(test<SequenceTraits<T> >(nullptr)) == 1);
};
@@ -296,7 +297,7 @@ struct has_FlowTraits<T, true>
static char (&f(...))[2];
public:
- static bool const value = sizeof(f<Derived>(0)) == 2;
+ static bool const value = sizeof(f<Derived>(nullptr)) == 2;
};