summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2015-10-06 23:24:35 +0000
committerHans Wennborg <hans@hanshq.net>2015-10-06 23:24:35 +0000
commit083ca9bb3233fb4df575bfb8c4198e3f9d6e3acd (patch)
tree81cfb3fc70e644d0ab252b18b9fabf6b764da86a /llvm/lib/IR
parent44780acd913643391779768c0b1d9259e294dbe8 (diff)
downloadbcm5719-llvm-083ca9bb3233fb4df575bfb8c4198e3f9d6e3acd.tar.gz
bcm5719-llvm-083ca9bb3233fb4df575bfb8c4198e3f9d6e3acd.zip
Fix Clang-tidy modernize-use-nullptr warnings in source directories and generated files; other minor cleanups.
Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13321 llvm-svn: 249482
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/BasicBlock.cpp6
-rw-r--r--llvm/lib/IR/Module.cpp4
2 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp
index 76bf176498d..97e4da41ea9 100644
--- a/llvm/lib/IR/BasicBlock.cpp
+++ b/llvm/lib/IR/BasicBlock.cpp
@@ -21,6 +21,7 @@
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Type.h"
#include <algorithm>
+
using namespace llvm;
ValueSymbolTable *BasicBlock::getValueSymbolTable() {
@@ -37,7 +38,6 @@ LLVMContext &BasicBlock::getContext() const {
// are not in the public header file...
template class llvm::SymbolTableListTraits<Instruction, BasicBlock>;
-
BasicBlock::BasicBlock(LLVMContext &C, const Twine &Name, Function *NewParent,
BasicBlock *InsertBefore)
: Value(Type::getLabelTy(C), Value::BasicBlockVal), Parent(nullptr) {
@@ -245,12 +245,12 @@ BasicBlock *BasicBlock::getSingleSuccessor() {
BasicBlock *BasicBlock::getUniqueSuccessor() {
succ_iterator SI = succ_begin(this), E = succ_end(this);
- if (SI == E) return NULL; // No successors
+ if (SI == E) return nullptr; // No successors
BasicBlock *SuccBB = *SI;
++SI;
for (;SI != E; ++SI) {
if (*SI != SuccBB)
- return NULL;
+ return nullptr;
// The same successor appears multiple times in the successor list.
// This is OK.
}
diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp
index 87cd222ef59..49586f42e10 100644
--- a/llvm/lib/IR/Module.cpp
+++ b/llvm/lib/IR/Module.cpp
@@ -29,6 +29,7 @@
#include <algorithm>
#include <cstdarg>
#include <cstdlib>
+
using namespace llvm;
//===----------------------------------------------------------------------===//
@@ -81,7 +82,6 @@ RandomNumberGenerator *Module::createRNG(const Pass* P) const {
return new RandomNumberGenerator(Salt);
}
-
/// getNamedValue - Return the first global value in the module with
/// the specified name, of arbitrary type. This method returns null
/// if a global with the specified name is not found.
@@ -481,7 +481,7 @@ Comdat *Module::getOrInsertComdat(StringRef Name) {
PICLevel::Level Module::getPICLevel() const {
auto *Val = cast_or_null<ConstantAsMetadata>(getModuleFlag("PIC Level"));
- if (Val == NULL)
+ if (!Val)
return PICLevel::Default;
return static_cast<PICLevel::Level>(
OpenPOWER on IntegriCloud