forked from OSchip/llvm-project
Minor cleanup to the code-completion-point logic suggested by Chris.
llvm-svn: 90459
This commit is contained in:
parent
cdeb800152
commit
5f49883488
|
@ -507,7 +507,7 @@ public:
|
||||||
|
|
||||||
/// \brief Determine if this source location refers into the file
|
/// \brief Determine if this source location refers into the file
|
||||||
/// for which we are performing code completion.
|
/// 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
|
/// Diag - Forwarding function for diagnostics. This emits a diagnostic at
|
||||||
/// the specified Token's location, translating the token's start
|
/// the specified Token's location, translating the token's start
|
||||||
|
|
|
@ -47,8 +47,7 @@ unsigned ContentCache::getSize() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContentCache::replaceBuffer(const llvm::MemoryBuffer *B) {
|
void ContentCache::replaceBuffer(const llvm::MemoryBuffer *B) {
|
||||||
if (B == Buffer)
|
assert(B != Buffer);
|
||||||
return;
|
|
||||||
|
|
||||||
delete Buffer;
|
delete Buffer;
|
||||||
Buffer = B;
|
Buffer = B;
|
||||||
|
|
|
@ -240,7 +240,7 @@ bool Preprocessor::SetCodeCompletionPoint(const FileEntry *File,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Preprocessor::isCodeCompletionFile(SourceLocation FileLoc) {
|
bool Preprocessor::isCodeCompletionFile(SourceLocation FileLoc) const {
|
||||||
return CodeCompletionFile && FileLoc.isFileID() &&
|
return CodeCompletionFile && FileLoc.isFileID() &&
|
||||||
SourceMgr.getFileEntryForID(SourceMgr.getFileID(FileLoc))
|
SourceMgr.getFileEntryForID(SourceMgr.getFileID(FileLoc))
|
||||||
== CodeCompletionFile;
|
== CodeCompletionFile;
|
||||||
|
|
Loading…
Reference in New Issue