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 | da176c6d6aee673ade66dbaa5065a035331e30db (patch) | |
| tree | 3a74bd0383b6db6b2a5e58b163fd56f77020851a /lib/Lex/HeaderMap.cpp | |
| parent | 9d83a9315e54ebb56a49819b77c8597f3aff1d08 (diff) | |
| download | clang-da176c6d6aee673ade66dbaa5065a035331e30db.tar.gz clang-da176c6d6aee673ade66dbaa5065a035331e30db.tar.bz2 clang-da176c6d6aee673ade66dbaa5065a035331e30db.tar.xz | |
[C++11] Use 'nullptr'. Lex edition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209083 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/HeaderMap.cpp')
| -rw-r--r-- | lib/Lex/HeaderMap.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Lex/HeaderMap.cpp b/lib/Lex/HeaderMap.cpp index 2d07428ea6..f6c658e119 100644 --- a/lib/Lex/HeaderMap.cpp +++ b/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); } |
