mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-01-05 23:23:53 +00:00
[C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206252 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -30,12 +30,12 @@ Module *llvm::ParseAssembly(MemoryBuffer *F,
|
||||
|
||||
// If we are parsing into an existing module, do it.
|
||||
if (M)
|
||||
return LLParser(F, SM, Err, M).Run() ? 0 : M;
|
||||
return LLParser(F, SM, Err, M).Run() ? nullptr : M;
|
||||
|
||||
// Otherwise create a new module.
|
||||
std::unique_ptr<Module> M2(new Module(F->getBufferIdentifier(), Context));
|
||||
if (LLParser(F, SM, Err, M2.get()).Run())
|
||||
return 0;
|
||||
return nullptr;
|
||||
return M2.release();
|
||||
}
|
||||
|
||||
@@ -45,10 +45,10 @@ Module *llvm::ParseAssemblyFile(const std::string &Filename, SMDiagnostic &Err,
|
||||
if (error_code ec = MemoryBuffer::getFileOrSTDIN(Filename, File)) {
|
||||
Err = SMDiagnostic(Filename, SourceMgr::DK_Error,
|
||||
"Could not open input file: " + ec.message());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return ParseAssembly(File.release(), 0, Err, Context);
|
||||
return ParseAssembly(File.release(), nullptr, Err, Context);
|
||||
}
|
||||
|
||||
Module *llvm::ParseAssemblyString(const char *AsmString, Module *M,
|
||||
|
||||
Reference in New Issue
Block a user