[cfe-commits] r90881 - /cfe/trunk/lib/Lex/Preprocessor.cpp

Douglas Gregor dgregor at apple.com
Tue Dec 8 13:45:46 PST 2009


Author: dgregor
Date: Tue Dec  8 15:45:46 2009
New Revision: 90881

URL: http://llvm.org/viewvc/llvm-project?rev=90881&view=rev
Log:
Don't expand tabs when computing the offset from the code-completion column

Modified:
    cfe/trunk/lib/Lex/Preprocessor.cpp

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

==============================================================================
--- cfe/trunk/lib/Lex/Preprocessor.cpp (original)
+++ cfe/trunk/lib/Lex/Preprocessor.cpp Tue Dec  8 15:45:46 2009
@@ -221,16 +221,10 @@
     }
   }
   
-  for (unsigned Column = 1; Column < TruncateAtColumn; ++Column, ++Position) {
-    if (!*Position)
-      break;
-    
-    if (*Position == '\t')
-      Column += 7;
-  }
+  Position += TruncateAtColumn - 1;
   
   // Truncate the buffer.
-  if (Position != Buffer->getBufferEnd()) {
+  if (Position < Buffer->getBufferEnd()) {
     MemoryBuffer *TruncatedBuffer 
       = MemoryBuffer::getMemBufferCopy(Buffer->getBufferStart(), Position, 
                                        Buffer->getBufferIdentifier());





More information about the cfe-commits mailing list