diff options
author | Craig Topper <craig.topper@gmail.com> | 2014-04-15 06:32:26 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2014-04-15 06:32:26 +0000 |
commit | 2617dccea2721fd74677f0a7bcf5a768238421d0 (patch) | |
tree | ad5ee2efaff543d7da11f1599bdabb6588d1c1dd /llvm/lib/IRReader | |
parent | d82d4cc3567e896fad35372adba9a676c7776cd0 (diff) | |
download | llvm-2617dccea2721fd74677f0a7bcf5a768238421d0.zip llvm-2617dccea2721fd74677f0a7bcf5a768238421d0.tar.gz llvm-2617dccea2721fd74677f0a7bcf5a768238421d0.tar.bz2 |
[C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr.
llvm-svn: 206252
Diffstat (limited to 'llvm/lib/IRReader')
-rw-r--r-- | llvm/lib/IRReader/IRReader.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/IRReader/IRReader.cpp b/llvm/lib/IRReader/IRReader.cpp index 8be8ab8..f4ed437 100644 --- a/llvm/lib/IRReader/IRReader.cpp +++ b/llvm/lib/IRReader/IRReader.cpp @@ -42,12 +42,12 @@ Module *llvm::getLazyIRModule(MemoryBuffer *Buffer, SMDiagnostic &Err, // ParseBitcodeFile does not take ownership of the Buffer in the // case of an error. delete Buffer; - return NULL; + return nullptr; } return ModuleOrErr.get(); } - return ParseAssembly(Buffer, 0, Err, Context); + return ParseAssembly(Buffer, nullptr, Err, Context); } Module *llvm::getLazyIRFileModule(const std::string &Filename, SMDiagnostic &Err, @@ -56,7 +56,7 @@ Module *llvm::getLazyIRFileModule(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 getLazyIRModule(File.release(), Err, Context); @@ -69,7 +69,7 @@ Module *llvm::ParseIR(MemoryBuffer *Buffer, SMDiagnostic &Err, if (isBitcode((const unsigned char *)Buffer->getBufferStart(), (const unsigned char *)Buffer->getBufferEnd())) { ErrorOr<Module *> ModuleOrErr = parseBitcodeFile(Buffer, Context); - Module *M = 0; + Module *M = nullptr; if (error_code EC = ModuleOrErr.getError()) Err = SMDiagnostic(Buffer->getBufferIdentifier(), SourceMgr::DK_Error, EC.message()); @@ -80,7 +80,7 @@ Module *llvm::ParseIR(MemoryBuffer *Buffer, SMDiagnostic &Err, return M; } - return ParseAssembly(Buffer, 0, Err, Context); + return ParseAssembly(Buffer, nullptr, Err, Context); } Module *llvm::ParseIRFile(const std::string &Filename, SMDiagnostic &Err, @@ -89,7 +89,7 @@ Module *llvm::ParseIRFile(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 ParseIR(File.release(), Err, Context); @@ -111,7 +111,7 @@ LLVMBool LLVMParseIRInContext(LLVMContextRef ContextRef, std::string buf; raw_string_ostream os(buf); - Diag.print(NULL, os, false); + Diag.print(nullptr, os, false); os.flush(); *OutMessage = strdup(buf.c_str()); |