summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2015-09-30 23:52:54 +0000
committerVedant Kumar <vsk@apple.com>2015-09-30 23:52:54 +0000
commit552c0111f1ad12ed6a8442fbfc3541f1f503cbc6 (patch)
tree3e18df8aa32914003354e7d3daf940d164af8448 /compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc
parent3830d68bc19890df83961799c644de96346b6459 (diff)
downloadbcm5719-llvm-552c0111f1ad12ed6a8442fbfc3541f1f503cbc6.tar.gz
bcm5719-llvm-552c0111f1ad12ed6a8442fbfc3541f1f503cbc6.zip
[sanitizer_common] Apply modernize-use-nullptr, other minor fixes
- Trim spaces. - Use nullptr in place of 0 for pointer variables. - Use '!p' in place of 'p == 0' for null pointer checks. Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13310 llvm-svn: 248964
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc')
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc b/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc
index 8c4aeffda45..fabd335856f 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include "sanitizer_platform.h"
+
#if SANITIZER_FREEBSD || SANITIZER_LINUX
#include "sanitizer_libignore.h"
@@ -38,11 +39,11 @@ void LibIgnore::OnLibraryLoaded(const char *name) {
BlockingMutexLock lock(&mutex_);
// Try to match suppressions with symlink target.
InternalScopedString buf(kMaxPathLength);
- if (name != 0 && internal_readlink(name, buf.data(), buf.size() - 1) > 0 &&
+ if (name && internal_readlink(name, buf.data(), buf.size() - 1) > 0 &&
buf[0]) {
for (uptr i = 0; i < count_; i++) {
Lib *lib = &libs_[i];
- if (!lib->loaded && lib->real_name == 0 &&
+ if (!lib->loaded && (!lib->real_name) &&
TemplateMatch(lib->templ, name))
lib->real_name = internal_strdup(buf.data());
}
@@ -60,7 +61,7 @@ void LibIgnore::OnLibraryLoaded(const char *name) {
if ((prot & MemoryMappingLayout::kProtectionExecute) == 0)
continue;
if (TemplateMatch(lib->templ, module.data()) ||
- (lib->real_name != 0 &&
+ (lib->real_name &&
internal_strcmp(lib->real_name, module.data()) == 0)) {
if (loaded) {
Report("%s: called_from_lib suppression '%s' is matched against"
@@ -93,9 +94,9 @@ void LibIgnore::OnLibraryLoaded(const char *name) {
}
void LibIgnore::OnLibraryUnloaded() {
- OnLibraryLoaded(0);
+ OnLibraryLoaded(nullptr);
}
-} // namespace __sanitizer
+} // namespace __sanitizer
-#endif // #if SANITIZER_FREEBSD || SANITIZER_LINUX
+#endif // #if SANITIZER_FREEBSD || SANITIZER_LINUX
OpenPOWER on IntegriCloud