diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Basic/SourceManager.cpp | 3 | ||||
-rw-r--r-- | clang/lib/Lex/Preprocessor.cpp | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index 8cc7a8438d2..a3e72e8b407 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -47,8 +47,7 @@ unsigned ContentCache::getSize() const { } void ContentCache::replaceBuffer(const llvm::MemoryBuffer *B) { - if (B == Buffer) - return; + assert(B != Buffer); delete Buffer; Buffer = B; diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index c7578204944..229826af5dd 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -240,7 +240,7 @@ bool Preprocessor::SetCodeCompletionPoint(const FileEntry *File, return false; } -bool Preprocessor::isCodeCompletionFile(SourceLocation FileLoc) { +bool Preprocessor::isCodeCompletionFile(SourceLocation FileLoc) const { return CodeCompletionFile && FileLoc.isFileID() && SourceMgr.getFileEntryForID(SourceMgr.getFileID(FileLoc)) == CodeCompletionFile; |