summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Module.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
-rw-r--r--llvm/lib/IR/Module.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp
index 1accd471a9a..43f42bcf87b 100644
--- a/llvm/lib/IR/Module.cpp
+++ b/llvm/lib/IR/Module.cpp
@@ -95,7 +95,7 @@ Constant *Module::getOrInsertFunction(StringRef Name,
AttributeSet AttributeList) {
// See if we have a definition for the specified function already.
GlobalValue *F = getNamedValue(Name);
- if (F == 0) {
+ if (!F) {
// Nope, add it
Function *New = Function::Create(Ty, GlobalVariable::ExternalLinkage, Name);
if (!New->isIntrinsic()) // Intrinsics get attrs set on construction
@@ -183,7 +183,7 @@ GlobalVariable *Module::getGlobalVariable(StringRef Name, bool AllowLocal) {
dyn_cast_or_null<GlobalVariable>(getNamedValue(Name)))
if (AllowLocal || !Result->hasLocalLinkage())
return Result;
- return 0;
+ return nullptr;
}
/// getOrInsertGlobal - Look up the specified global in the module symbol table.
@@ -195,11 +195,11 @@ GlobalVariable *Module::getGlobalVariable(StringRef Name, bool AllowLocal) {
Constant *Module::getOrInsertGlobal(StringRef Name, Type *Ty) {
// See if we have a definition for the specified global already.
GlobalVariable *GV = dyn_cast_or_null<GlobalVariable>(getNamedValue(Name));
- if (GV == 0) {
+ if (!GV) {
// Nope, add it
GlobalVariable *New =
new GlobalVariable(*this, Ty, false, GlobalVariable::ExternalLinkage,
- 0, Name);
+ nullptr, Name);
return New; // Return the new declaration.
}
@@ -284,7 +284,7 @@ Value *Module::getModuleFlag(StringRef Key) const {
if (Key == MFE.Key->getString())
return MFE.Val;
}
- return 0;
+ return nullptr;
}
/// getModuleFlagsMetadata - Returns the NamedMDNode in the module that
@@ -350,7 +350,7 @@ void Module::setDataLayout(const DataLayout *Other) {
const DataLayout *Module::getDataLayout() const {
if (DataLayoutStr.empty())
- return 0;
+ return nullptr;
return &DL;
}
OpenPOWER on IntegriCloud