diff options
author | Zarko Todorovski <zarko@ca.ibm.com> | 2021-11-19 14:50:09 -0500 |
---|---|---|
committer | Zarko Todorovski <zarko@ca.ibm.com> | 2021-11-19 14:58:35 -0500 |
commit | d8e5a0c42bd8796cce9caa53aacab88c7cb2a3eb (patch) | |
tree | fcbd549681526fd97561a76c10db9dc00ff8c955 /clang/lib/Basic/SourceManager.cpp | |
parent | e0f58444e126e80a0d43eb5b88622799910195e6 (diff) | |
download | llvm-d8e5a0c42bd8796cce9caa53aacab88c7cb2a3eb.zip llvm-d8e5a0c42bd8796cce9caa53aacab88c7cb2a3eb.tar.gz llvm-d8e5a0c42bd8796cce9caa53aacab88c7cb2a3eb.tar.bz2 |
[clang][NFC] Inclusive terms: replace some uses of sanity in clang
Rewording of comments to avoid using `sanity test, sanity check`.
Reviewed By: aaron.ballman, Quuxplusone
Differential Revision: https://reviews.llvm.org/D114025
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r-- | clang/lib/Basic/SourceManager.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index c2e7b68..ec3e355 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -59,12 +59,10 @@ unsigned ContentCache::getSizeBytesMapped() const { /// Returns the kind of memory used to back the memory buffer for /// this content cache. This is used for performance analysis. llvm::MemoryBuffer::BufferKind ContentCache::getMemoryBufferKind() const { - assert(Buffer); - - // Should be unreachable, but keep for sanity. - if (!Buffer) + if (Buffer == nullptr) { + assert(0 && "Buffer should never be null"); return llvm::MemoryBuffer::MemoryBuffer_Malloc; - + } return Buffer->getBufferKind(); } @@ -864,7 +862,6 @@ FileID SourceManager::getFileIDLocal(SourceLocation::UIntTy SLocOffset) const { /// This function knows that the SourceLocation is in a loaded buffer, not a /// local one. FileID SourceManager::getFileIDLoaded(SourceLocation::UIntTy SLocOffset) const { - // Sanity checking, otherwise a bug may lead to hanging in release build. if (SLocOffset < CurrentLoadedOffset) { assert(0 && "Invalid SLocOffset or bad function choice"); return FileID(); @@ -909,7 +906,6 @@ FileID SourceManager::getFileIDLoaded(SourceLocation::UIntTy SLocOffset) const { ++NumProbes; if (E.getOffset() > SLocOffset) { - // Sanity checking, otherwise a bug may lead to hanging in release build. if (GreaterIndex == MiddleIndex) { assert(0 && "binary search missed the entry"); return FileID(); @@ -925,7 +921,6 @@ FileID SourceManager::getFileIDLoaded(SourceLocation::UIntTy SLocOffset) const { return Res; } - // Sanity checking, otherwise a bug may lead to hanging in release build. if (LessIndex == MiddleIndex) { assert(0 && "binary search missed the entry"); return FileID(); |