diff options
author | Craig Topper <craig.topper@gmail.com> | 2014-05-17 23:10:59 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2014-05-17 23:10:59 +0000 |
commit | d2d442ca7385fe5c50f43c2731710ab1ac564ddb (patch) | |
tree | c942d260a048a2c5df5cc9f8ee62b2d34769d1c2 /clang/lib/Lex/HeaderMap.cpp | |
parent | f3a5a5c54698150c264ddda39cb61a219184e5ae (diff) | |
download | llvm-d2d442ca7385fe5c50f43c2731710ab1ac564ddb.tar.gz |
[C++11] Use 'nullptr'. Lex edition.
llvm-svn: 209083
Diffstat (limited to 'clang/lib/Lex/HeaderMap.cpp')
-rw-r--r-- | clang/lib/Lex/HeaderMap.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Lex/HeaderMap.cpp b/clang/lib/Lex/HeaderMap.cpp index 2d07428ea6fa..f6c658e11926 100644 --- a/clang/lib/Lex/HeaderMap.cpp +++ b/clang/lib/Lex/HeaderMap.cpp @@ -79,10 +79,10 @@ static inline unsigned HashHMapKey(StringRef Str) { const HeaderMap *HeaderMap::Create(const FileEntry *FE, FileManager &FM) { // If the file is too small to be a header map, ignore it. unsigned FileSize = FE->getSize(); - if (FileSize <= sizeof(HMapHeader)) return 0; + if (FileSize <= sizeof(HMapHeader)) return nullptr; std::unique_ptr<const llvm::MemoryBuffer> FileBuffer(FM.getBufferForFile(FE)); - if (!FileBuffer) return 0; // Unreadable file? + if (!FileBuffer) return nullptr; // Unreadable file? const char *FileStart = FileBuffer->getBufferStart(); // We know the file is at least as big as the header, check it now. @@ -98,9 +98,9 @@ const HeaderMap *HeaderMap::Create(const FileEntry *FE, FileManager &FM) { Header->Version == llvm::ByteSwap_16(HMAP_HeaderVersion)) NeedsByteSwap = true; // Mixed endianness headermap. else - return 0; // Not a header map. + return nullptr; // Not a header map. - if (Header->Reserved != 0) return 0; + if (Header->Reserved != 0) return nullptr; // Okay, everything looks good, create the header map. return new HeaderMap(FileBuffer.release(), NeedsByteSwap); @@ -165,7 +165,7 @@ const char *HeaderMap::getString(unsigned StrTabIdx) const { // Check for invalid index. if (StrTabIdx >= FileBuffer->getBufferSize()) - return 0; + return nullptr; // Otherwise, we have a valid pointer into the file. Just return it. We know // that the "string" can not overrun the end of the file, because the buffer @@ -205,7 +205,7 @@ const FileEntry *HeaderMap::LookupFile( SmallString<1024> Path; StringRef Dest = lookupFilename(Filename, Path); if (Dest.empty()) - return 0; + return nullptr; return FM.getFile(Dest); } |