diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-12-03 17:05:59 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-12-03 17:05:59 +0000 |
commit | 5f498834881dd4c36eadf903359b81ce63f731c9 (patch) | |
tree | a3603d5cddad0da3d2e1c20cdf97d133ddaaa150 /clang | |
parent | cdeb800152471d36ea2c424ca78228de619c52ef (diff) | |
download | bcm5719-llvm-5f498834881dd4c36eadf903359b81ce63f731c9.tar.gz bcm5719-llvm-5f498834881dd4c36eadf903359b81ce63f731c9.zip |
Minor cleanup to the code-completion-point logic suggested by Chris.
llvm-svn: 90459
Diffstat (limited to 'clang')
-rw-r--r-- | clang/include/clang/Lex/Preprocessor.h | 2 | ||||
-rw-r--r-- | clang/lib/Basic/SourceManager.cpp | 3 | ||||
-rw-r--r-- | clang/lib/Lex/Preprocessor.cpp | 2 |
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; |