aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/Lex/Preprocessor.h2
-rw-r--r--lib/Basic/SourceManager.cpp3
-rw-r--r--lib/Lex/Preprocessor.cpp2
3 files changed, 3 insertions, 4 deletions
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h
index 939444167b..cd202e5899 100644
--- a/include/clang/Lex/Preprocessor.h
+++ b/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/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp
index 8cc7a8438d..a3e72e8b40 100644
--- a/lib/Basic/SourceManager.cpp
+++ b/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/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp
index c757820494..229826af5d 100644
--- a/lib/Lex/Preprocessor.cpp
+++ b/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;