[cfe-commits] r90459 - in /cfe/trunk: include/clang/Lex/Preprocessor.h lib/Basic/SourceManager.cpp lib/Lex/Preprocessor.cpp

Douglas Gregor dgregor at apple.com
Thu Dec 3 09:05:59 PST 2009


Author: dgregor
Date: Thu Dec  3 11:05:59 2009
New Revision: 90459

URL: http://llvm.org/viewvc/llvm-project?rev=90459&view=rev
Log:
Minor cleanup to the code-completion-point logic suggested by Chris.

Modified:
    cfe/trunk/include/clang/Lex/Preprocessor.h
    cfe/trunk/lib/Basic/SourceManager.cpp
    cfe/trunk/lib/Lex/Preprocessor.cpp

Modified: cfe/trunk/include/clang/Lex/Preprocessor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Preprocessor.h?rev=90459&r1=90458&r2=90459&view=diff

==============================================================================
--- cfe/trunk/include/clang/Lex/Preprocessor.h (original)
+++ cfe/trunk/include/clang/Lex/Preprocessor.h Thu Dec  3 11:05:59 2009
@@ -507,7 +507,7 @@
 
   /// \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

Modified: cfe/trunk/lib/Basic/SourceManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SourceManager.cpp?rev=90459&r1=90458&r2=90459&view=diff

==============================================================================
--- cfe/trunk/lib/Basic/SourceManager.cpp (original)
+++ cfe/trunk/lib/Basic/SourceManager.cpp Thu Dec  3 11:05:59 2009
@@ -47,8 +47,7 @@
 }
 
 void ContentCache::replaceBuffer(const llvm::MemoryBuffer *B) {
-  if (B == Buffer)
-    return;
+  assert(B != Buffer);
   
   delete Buffer;
   Buffer = B;

Modified: cfe/trunk/lib/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Preprocessor.cpp?rev=90459&r1=90458&r2=90459&view=diff

==============================================================================
--- cfe/trunk/lib/Lex/Preprocessor.cpp (original)
+++ cfe/trunk/lib/Lex/Preprocessor.cpp Thu Dec  3 11:05:59 2009
@@ -240,7 +240,7 @@
   return false;
 }
 
-bool Preprocessor::isCodeCompletionFile(SourceLocation FileLoc) {
+bool Preprocessor::isCodeCompletionFile(SourceLocation FileLoc) const {
   return CodeCompletionFile && FileLoc.isFileID() &&
     SourceMgr.getFileEntryForID(SourceMgr.getFileID(FileLoc))
       == CodeCompletionFile;





More information about the cfe-commits mailing list