diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-02-16 09:31:36 +0000 |
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-02-16 09:31:36 +0000 |
| commit | ecb7e5c8afe929ee38155db94de6b084ec32a645 (patch) | |
| tree | 53010172e19c77ea447bcd89e117cda052ab52e0 /lib/Lex/Lexer.cpp | |
| parent | 5044f5c816adfd5cba17f1adee1a10127296d0bf (diff) | |
Update clang to r96341.
Notes
Notes:
svn path=/vendor/clang/dist/; revision=203955
Diffstat (limited to 'lib/Lex/Lexer.cpp')
| -rw-r--r-- | lib/Lex/Lexer.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp index afd1ba885167..3207062ccadd 100644 --- a/lib/Lex/Lexer.cpp +++ b/lib/Lex/Lexer.cpp @@ -985,10 +985,11 @@ bool Lexer::SkipBCPLComment(Token &Result, const char *CurPtr) { if (CurPtr == BufferEnd+1) { --CurPtr; break; } } while (C != '\n' && C != '\r'); - // Found but did not consume the newline. - if (PP && PP->HandleComment(Result, - SourceRange(getSourceLocation(BufferPtr), - getSourceLocation(CurPtr)))) { + // Found but did not consume the newline. Notify comment handlers about the + // comment unless we're in a #if 0 block. + if (PP && !isLexingRawMode() && + PP->HandleComment(Result, SourceRange(getSourceLocation(BufferPtr), + getSourceLocation(CurPtr)))) { BufferPtr = CurPtr; return true; // A token has to be returned. } @@ -1235,9 +1236,10 @@ bool Lexer::SkipBlockComment(Token &Result, const char *CurPtr) { C = *CurPtr++; } - if (PP && PP->HandleComment(Result, - SourceRange(getSourceLocation(BufferPtr), - getSourceLocation(CurPtr)))) { + // Notify comment handlers about the comment unless we're in a #if 0 block. + if (PP && !isLexingRawMode() && + PP->HandleComment(Result, SourceRange(getSourceLocation(BufferPtr), + getSourceLocation(CurPtr)))) { BufferPtr = CurPtr; return true; // A token has to be returned. } |
