summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/include/clang/Lex/Preprocessor.h2
-rw-r--r--clang/lib/Basic/SourceManager.cpp3
-rw-r--r--clang/lib/Lex/Preprocessor.cpp2
3 files changed, 3 insertions, 4 deletions
diff --git a/clang/include/clang/Lex/Preprocessor.h b/clang/include/clang/Lex/Preprocessor.h
index 939444167bb..cd202e58998 100644
--- a/clang/include/clang/Lex/Preprocessor.h
+++ b/clang/include/clang/Lex/Preprocessor.h
@@ -507,7 +507,7 @@ public:
/// \brief Determine if this source location refers into the file
/// for which we are performing code completion.
- bool isCodeCompletionFile(SourceLocation FileLoc);
+ bool isCodeCompletionFile(SourceLocation FileLoc) const;
/// Diag - Forwarding function for diagnostics. This emits a diagnostic at
/// the specified Token's location, translating the token's start
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;
OpenPOWER on IntegriCloud