mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 21:24:00 +00:00
[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@205831 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user