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

Daniel Dunbar daniel at zuster.org
Tue Dec 8 22:39:02 PST 2009


On Tue, Dec 8, 2009 at 1:45 PM, Douglas Gregor <dgregor at apple.com> wrote:
> 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

Test case?

 - Daniel

> 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());
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>




More information about the cfe-commits mailing list