• Home
  • Raw
  • Download

Lines Matching refs:CurPtr

560     const char *CurPtr = Buffer.begin();  in ComputePreamble()  local
562 while (CurPtr != Buffer.end()) { in ComputePreamble()
563 char ch = *CurPtr++; in ComputePreamble()
570 if (CurPtr != Buffer.end()) in ComputePreamble()
571 MaxLineOffset = CurPtr - Buffer.begin(); in ComputePreamble()
1459 bool Lexer::tryConsumeIdentifierUCN(const char *&CurPtr, unsigned Size, in tryConsumeIdentifierUCN() argument
1461 const char *UCNPtr = CurPtr + Size; in tryConsumeIdentifierUCN()
1462 uint32_t CodePoint = tryReadUCN(UCNPtr, CurPtr, /*Token=*/nullptr); in tryConsumeIdentifierUCN()
1468 makeCharRange(*this, CurPtr, UCNPtr), in tryConsumeIdentifierUCN()
1472 if ((UCNPtr - CurPtr == 6 && CurPtr[1] == 'u') || in tryConsumeIdentifierUCN()
1473 (UCNPtr - CurPtr == 10 && CurPtr[1] == 'U')) in tryConsumeIdentifierUCN()
1474 CurPtr = UCNPtr; in tryConsumeIdentifierUCN()
1476 while (CurPtr != UCNPtr) in tryConsumeIdentifierUCN()
1477 (void)getAndAdvanceChar(CurPtr, Result); in tryConsumeIdentifierUCN()
1481 bool Lexer::tryConsumeIdentifierUTF8Char(const char *&CurPtr) { in tryConsumeIdentifierUTF8Char() argument
1482 const char *UnicodePtr = CurPtr; in tryConsumeIdentifierUTF8Char()
1495 makeCharRange(*this, CurPtr, UnicodePtr), in tryConsumeIdentifierUTF8Char()
1498 CurPtr = UnicodePtr; in tryConsumeIdentifierUTF8Char()
1502 bool Lexer::LexIdentifier(Token &Result, const char *CurPtr) { in LexIdentifier() argument
1505 unsigned char C = *CurPtr++; in LexIdentifier()
1507 C = *CurPtr++; in LexIdentifier()
1509 --CurPtr; // Back up over the skipped character. in LexIdentifier()
1520 FormTokenWithChars(Result, CurPtr, tok::raw_identifier); in LexIdentifier()
1542 C = getCharAndSize(CurPtr, Size); in LexIdentifier()
1550 Diag(CurPtr, diag::ext_dollar_in_identifier); in LexIdentifier()
1551 CurPtr = ConsumeChar(CurPtr, Size, Result); in LexIdentifier()
1552 C = getCharAndSize(CurPtr, Size); in LexIdentifier()
1555 } else if (C == '\\' && tryConsumeIdentifierUCN(CurPtr, Size, Result)) { in LexIdentifier()
1556 C = getCharAndSize(CurPtr, Size); in LexIdentifier()
1558 } else if (!isASCII(C) && tryConsumeIdentifierUTF8Char(CurPtr)) { in LexIdentifier()
1559 C = getCharAndSize(CurPtr, Size); in LexIdentifier()
1566 CurPtr = ConsumeChar(CurPtr, Size, Result); in LexIdentifier()
1568 C = getCharAndSize(CurPtr, Size); in LexIdentifier()
1570 CurPtr = ConsumeChar(CurPtr, Size, Result); in LexIdentifier()
1571 C = getCharAndSize(CurPtr, Size); in LexIdentifier()
1590 bool Lexer::LexNumericConstant(Token &Result, const char *CurPtr) { in LexNumericConstant() argument
1592 char C = getCharAndSize(CurPtr, Size); in LexNumericConstant()
1595 CurPtr = ConsumeChar(CurPtr, Size, Result); in LexNumericConstant()
1597 C = getCharAndSize(CurPtr, Size); in LexNumericConstant()
1605 return LexNumericConstant(Result, ConsumeChar(CurPtr, Size, Result)); in LexNumericConstant()
1618 std::find(BufferPtr, CurPtr, '_') != CurPtr) in LexNumericConstant()
1622 return LexNumericConstant(Result, ConsumeChar(CurPtr, Size, Result)); in LexNumericConstant()
1628 char Next = getCharAndSizeNoWarn(CurPtr + Size, NextSize, getLangOpts()); in LexNumericConstant()
1631 Diag(CurPtr, diag::warn_cxx11_compat_digit_separator); in LexNumericConstant()
1632 CurPtr = ConsumeChar(CurPtr, Size, Result); in LexNumericConstant()
1633 CurPtr = ConsumeChar(CurPtr, NextSize, Result); in LexNumericConstant()
1634 return LexNumericConstant(Result, CurPtr); in LexNumericConstant()
1639 if (C == '\\' && tryConsumeIdentifierUCN(CurPtr, Size, Result)) in LexNumericConstant()
1640 return LexNumericConstant(Result, CurPtr); in LexNumericConstant()
1641 if (!isASCII(C) && tryConsumeIdentifierUTF8Char(CurPtr)) in LexNumericConstant()
1642 return LexNumericConstant(Result, CurPtr); in LexNumericConstant()
1646 FormTokenWithChars(Result, CurPtr, tok::numeric_constant); in LexNumericConstant()
1653 const char *Lexer::LexUDSuffix(Token &Result, const char *CurPtr, in LexUDSuffix() argument
1659 char C = getCharAndSize(CurPtr, Size); in LexUDSuffix()
1663 if (C == '\\' && tryConsumeIdentifierUCN(CurPtr, Size, Result)) in LexUDSuffix()
1665 else if (!isASCII(C) && tryConsumeIdentifierUTF8Char(CurPtr)) in LexUDSuffix()
1668 return CurPtr; in LexUDSuffix()
1673 Diag(CurPtr, in LexUDSuffix()
1676 << FixItHint::CreateInsertion(getSourceLocation(CurPtr), " "); in LexUDSuffix()
1677 return CurPtr; in LexUDSuffix()
1699 char Next = getCharAndSizeNoWarn(CurPtr + Consumed, NextSize, in LexUDSuffix()
1720 Diag(CurPtr, getLangOpts().MSVCCompat in LexUDSuffix()
1723 << FixItHint::CreateInsertion(getSourceLocation(CurPtr), " "); in LexUDSuffix()
1724 return CurPtr; in LexUDSuffix()
1727 CurPtr = ConsumeChar(CurPtr, Size, Result); in LexUDSuffix()
1732 C = getCharAndSize(CurPtr, Size); in LexUDSuffix()
1733 if (isIdentifierBody(C)) { CurPtr = ConsumeChar(CurPtr, Size, Result); } in LexUDSuffix()
1734 else if (C == '\\' && tryConsumeIdentifierUCN(CurPtr, Size, Result)) {} in LexUDSuffix()
1735 else if (!isASCII(C) && tryConsumeIdentifierUTF8Char(CurPtr)) {} in LexUDSuffix()
1739 return CurPtr; in LexUDSuffix()
1744 bool Lexer::LexStringLiteral(Token &Result, const char *CurPtr, in LexStringLiteral() argument
1757 char C = getAndAdvanceChar(CurPtr, Result); in LexStringLiteral()
1762 C = getAndAdvanceChar(CurPtr, Result); in LexStringLiteral()
1765 (C == 0 && CurPtr-1 == BufferEnd)) { // End of file. in LexStringLiteral()
1768 FormTokenWithChars(Result, CurPtr-1, tok::unknown); in LexStringLiteral()
1773 if (isCodeCompletionPoint(CurPtr-1)) { in LexStringLiteral()
1775 FormTokenWithChars(Result, CurPtr-1, tok::unknown); in LexStringLiteral()
1780 NulCharacter = CurPtr-1; in LexStringLiteral()
1782 C = getAndAdvanceChar(CurPtr, Result); in LexStringLiteral()
1787 CurPtr = LexUDSuffix(Result, CurPtr, true); in LexStringLiteral()
1795 FormTokenWithChars(Result, CurPtr, Kind); in LexStringLiteral()
1802 bool Lexer::LexRawStringLiteral(Token &Result, const char *CurPtr, in LexRawStringLiteral() argument
1814 while (PrefixLen != 16 && isRawStringDelimBody(CurPtr[PrefixLen])) in LexRawStringLiteral()
1818 if (CurPtr[PrefixLen] != '(') { in LexRawStringLiteral()
1820 const char *PrefixEnd = &CurPtr[PrefixLen]; in LexRawStringLiteral()
1833 char C = *CurPtr++; in LexRawStringLiteral()
1837 if (C == 0 && CurPtr-1 == BufferEnd) { in LexRawStringLiteral()
1838 --CurPtr; in LexRawStringLiteral()
1843 FormTokenWithChars(Result, CurPtr, tok::unknown); in LexRawStringLiteral()
1848 const char *Prefix = CurPtr; in LexRawStringLiteral()
1849 CurPtr += PrefixLen + 1; // skip over prefix and '(' in LexRawStringLiteral()
1852 char C = *CurPtr++; in LexRawStringLiteral()
1856 if (strncmp(CurPtr, Prefix, PrefixLen) == 0 && CurPtr[PrefixLen] == '"') { in LexRawStringLiteral()
1857 CurPtr += PrefixLen + 1; // skip over prefix and '"' in LexRawStringLiteral()
1860 } else if (C == 0 && CurPtr-1 == BufferEnd) { // End of file. in LexRawStringLiteral()
1864 FormTokenWithChars(Result, CurPtr-1, tok::unknown); in LexRawStringLiteral()
1871 CurPtr = LexUDSuffix(Result, CurPtr, true); in LexRawStringLiteral()
1875 FormTokenWithChars(Result, CurPtr, Kind); in LexRawStringLiteral()
1882 bool Lexer::LexAngledStringLiteral(Token &Result, const char *CurPtr) { in LexAngledStringLiteral() argument
1885 const char *AfterLessPos = CurPtr; in LexAngledStringLiteral()
1886 char C = getAndAdvanceChar(CurPtr, Result); in LexAngledStringLiteral()
1889 if (C == '\\' && CurPtr < BufferEnd) { in LexAngledStringLiteral()
1891 getAndAdvanceChar(CurPtr, Result); in LexAngledStringLiteral()
1893 (C == 0 && (CurPtr-1 == BufferEnd || // End of file. in LexAngledStringLiteral()
1894 isCodeCompletionPoint(CurPtr-1)))) { in LexAngledStringLiteral()
1900 NulCharacter = CurPtr-1; in LexAngledStringLiteral()
1902 C = getAndAdvanceChar(CurPtr, Result); in LexAngledStringLiteral()
1911 FormTokenWithChars(Result, CurPtr, tok::angle_string_literal); in LexAngledStringLiteral()
1919 bool Lexer::LexCharConstant(Token &Result, const char *CurPtr, in LexCharConstant() argument
1933 char C = getAndAdvanceChar(CurPtr, Result); in LexCharConstant()
1937 FormTokenWithChars(Result, CurPtr, tok::unknown); in LexCharConstant()
1944 C = getAndAdvanceChar(CurPtr, Result); in LexCharConstant()
1947 (C == 0 && CurPtr-1 == BufferEnd)) { // End of file. in LexCharConstant()
1950 FormTokenWithChars(Result, CurPtr-1, tok::unknown); in LexCharConstant()
1955 if (isCodeCompletionPoint(CurPtr-1)) { in LexCharConstant()
1957 FormTokenWithChars(Result, CurPtr-1, tok::unknown); in LexCharConstant()
1962 NulCharacter = CurPtr-1; in LexCharConstant()
1964 C = getAndAdvanceChar(CurPtr, Result); in LexCharConstant()
1969 CurPtr = LexUDSuffix(Result, CurPtr, false); in LexCharConstant()
1977 FormTokenWithChars(Result, CurPtr, Kind); in LexCharConstant()
1987 bool Lexer::SkipWhitespace(Token &Result, const char *CurPtr, in SkipWhitespace() argument
1990 bool SawNewline = isVerticalWhitespace(CurPtr[-1]); in SkipWhitespace()
1992 unsigned char Char = *CurPtr; in SkipWhitespace()
1998 Char = *++CurPtr; in SkipWhitespace()
2006 BufferPtr = CurPtr; in SkipWhitespace()
2012 Char = *++CurPtr; in SkipWhitespace()
2017 FormTokenWithChars(Result, CurPtr, tok::unknown); in SkipWhitespace()
2027 char PrevChar = CurPtr[-1]; in SkipWhitespace()
2036 BufferPtr = CurPtr; in SkipWhitespace()
2046 bool Lexer::SkipLineComment(Token &Result, const char *CurPtr, in SkipLineComment() argument
2063 C = *CurPtr; in SkipLineComment()
2067 C = *++CurPtr; in SkipLineComment()
2069 const char *NextLine = CurPtr; in SkipLineComment()
2072 const char *EscapePtr = CurPtr-1; in SkipLineComment()
2080 CurPtr = EscapePtr; in SkipLineComment()
2083 CurPtr = EscapePtr-2; in SkipLineComment()
2096 const char *OldPtr = CurPtr; in SkipLineComment()
2099 C = getAndAdvanceChar(CurPtr, Result); in SkipLineComment()
2104 if (C != 0 && CurPtr == OldPtr+1) { in SkipLineComment()
2105 CurPtr = NextLine; in SkipLineComment()
2112 if (CurPtr != OldPtr+1 && C != '/' && CurPtr[0] != '/') { in SkipLineComment()
2113 for (; OldPtr != CurPtr; ++OldPtr) in SkipLineComment()
2118 const char *ForwardPtr = CurPtr; in SkipLineComment()
2131 if (CurPtr == BufferEnd+1) { in SkipLineComment()
2132 --CurPtr; in SkipLineComment()
2136 if (C == '\0' && isCodeCompletionPoint(CurPtr-1)) { in SkipLineComment()
2148 getSourceLocation(CurPtr)))) { in SkipLineComment()
2149 BufferPtr = CurPtr; in SkipLineComment()
2155 return SaveLineComment(Result, CurPtr); in SkipLineComment()
2159 if (ParsingPreprocessorDirective || CurPtr == BufferEnd) { in SkipLineComment()
2160 BufferPtr = CurPtr; in SkipLineComment()
2169 ++CurPtr; in SkipLineComment()
2176 BufferPtr = CurPtr; in SkipLineComment()
2182 bool Lexer::SaveLineComment(Token &Result, const char *CurPtr) { in SaveLineComment() argument
2185 FormTokenWithChars(Result, CurPtr, tok::comment); in SaveLineComment()
2210 static bool isEndOfBlockCommentWithEscapedNewLine(const char *CurPtr, in isEndOfBlockCommentWithEscapedNewLine() argument
2212 assert(CurPtr[0] == '\n' || CurPtr[0] == '\r'); in isEndOfBlockCommentWithEscapedNewLine()
2215 --CurPtr; in isEndOfBlockCommentWithEscapedNewLine()
2218 if (CurPtr[0] == '\n' || CurPtr[0] == '\r') { in isEndOfBlockCommentWithEscapedNewLine()
2220 if (CurPtr[0] == CurPtr[1]) in isEndOfBlockCommentWithEscapedNewLine()
2223 --CurPtr; in isEndOfBlockCommentWithEscapedNewLine()
2229 while (isHorizontalWhitespace(*CurPtr) || *CurPtr == 0) { in isEndOfBlockCommentWithEscapedNewLine()
2230 --CurPtr; in isEndOfBlockCommentWithEscapedNewLine()
2235 if (*CurPtr == '\\') { in isEndOfBlockCommentWithEscapedNewLine()
2236 if (CurPtr[-1] != '*') return false; in isEndOfBlockCommentWithEscapedNewLine()
2239 if (CurPtr[0] != '/' || CurPtr[-1] != '?' || CurPtr[-2] != '?' || in isEndOfBlockCommentWithEscapedNewLine()
2240 CurPtr[-3] != '*') in isEndOfBlockCommentWithEscapedNewLine()
2244 CurPtr -= 2; in isEndOfBlockCommentWithEscapedNewLine()
2250 L->Diag(CurPtr, diag::trigraph_ignored_block_comment); in isEndOfBlockCommentWithEscapedNewLine()
2254 L->Diag(CurPtr, diag::trigraph_ends_block_comment); in isEndOfBlockCommentWithEscapedNewLine()
2259 L->Diag(CurPtr, diag::escaped_newline_block_comment_end); in isEndOfBlockCommentWithEscapedNewLine()
2263 L->Diag(CurPtr, diag::backslash_newline_space); in isEndOfBlockCommentWithEscapedNewLine()
2284 bool Lexer::SkipBlockComment(Token &Result, const char *CurPtr, in SkipBlockComment() argument
2295 unsigned char C = getCharAndSize(CurPtr, CharSize); in SkipBlockComment()
2296 CurPtr += CharSize; in SkipBlockComment()
2297 if (C == 0 && CurPtr == BufferEnd+1) { in SkipBlockComment()
2300 --CurPtr; in SkipBlockComment()
2305 FormTokenWithChars(Result, CurPtr, tok::unknown); in SkipBlockComment()
2309 BufferPtr = CurPtr; in SkipBlockComment()
2316 C = *CurPtr++; in SkipBlockComment()
2321 if (CurPtr + 24 < BufferEnd && in SkipBlockComment()
2326 while (C != '/' && ((intptr_t)CurPtr & 0x0F) != 0) in SkipBlockComment()
2327 C = *CurPtr++; in SkipBlockComment()
2333 while (CurPtr+16 <= BufferEnd) { in SkipBlockComment()
2334 int cmp = _mm_movemask_epi8(_mm_cmpeq_epi8(*(const __m128i*)CurPtr, in SkipBlockComment()
2340 CurPtr += llvm::countTrailingZeros<unsigned>(cmp) + 1; in SkipBlockComment()
2343 CurPtr += 16; in SkipBlockComment()
2350 while (CurPtr+16 <= BufferEnd && in SkipBlockComment()
2351 !vec_any_eq(*(const vector unsigned char*)CurPtr, Slashes)) in SkipBlockComment()
2352 CurPtr += 16; in SkipBlockComment()
2355 while (CurPtr[0] != '/' && in SkipBlockComment()
2356 CurPtr[1] != '/' && in SkipBlockComment()
2357 CurPtr[2] != '/' && in SkipBlockComment()
2358 CurPtr[3] != '/' && in SkipBlockComment()
2359 CurPtr+4 < BufferEnd) { in SkipBlockComment()
2360 CurPtr += 4; in SkipBlockComment()
2365 C = *CurPtr++; in SkipBlockComment()
2370 C = *CurPtr++; in SkipBlockComment()
2374 if (CurPtr[-2] == '*') // We found the final */. We're done! in SkipBlockComment()
2377 if ((CurPtr[-2] == '\n' || CurPtr[-2] == '\r')) { in SkipBlockComment()
2378 if (isEndOfBlockCommentWithEscapedNewLine(CurPtr-2, this)) { in SkipBlockComment()
2384 if (CurPtr[0] == '*' && CurPtr[1] != '/') { in SkipBlockComment()
2389 Diag(CurPtr-1, diag::warn_nested_block_comment); in SkipBlockComment()
2391 } else if (C == 0 && CurPtr == BufferEnd+1) { in SkipBlockComment()
2397 --CurPtr; in SkipBlockComment()
2402 FormTokenWithChars(Result, CurPtr, tok::unknown); in SkipBlockComment()
2406 BufferPtr = CurPtr; in SkipBlockComment()
2408 } else if (C == '\0' && isCodeCompletionPoint(CurPtr-1)) { in SkipBlockComment()
2414 C = *CurPtr++; in SkipBlockComment()
2420 getSourceLocation(CurPtr)))) { in SkipBlockComment()
2421 BufferPtr = CurPtr; in SkipBlockComment()
2427 FormTokenWithChars(Result, CurPtr, tok::comment); in SkipBlockComment()
2435 if (isHorizontalWhitespace(*CurPtr)) { in SkipBlockComment()
2436 SkipWhitespace(Result, CurPtr+1, TokAtPhysicalStartOfLine); in SkipBlockComment()
2441 BufferPtr = CurPtr; in SkipBlockComment()
2458 const char *CurPtr = BufferPtr; in ReadToEndOfLine() local
2460 char Char = getAndAdvanceChar(CurPtr, Tmp); in ReadToEndOfLine()
2468 if (CurPtr-1 != BufferEnd) { in ReadToEndOfLine()
2469 if (isCodeCompletionPoint(CurPtr-1)) { in ReadToEndOfLine()
2484 assert(CurPtr[-1] == Char && "Trigraphs for newline?"); in ReadToEndOfLine()
2485 BufferPtr = CurPtr-1; in ReadToEndOfLine()
2506 bool Lexer::LexEndOfFile(Token &Result, const char *CurPtr) { in LexEndOfFile() argument
2514 FormTokenWithChars(Result, CurPtr, tok::eod); in LexEndOfFile()
2543 if (CurPtr != BufferStart && (CurPtr[-1] != '\n' && CurPtr[-1] != '\r')) { in LexEndOfFile()
2565 BufferPtr = CurPtr; in LexEndOfFile()
2609 static const char *FindConflictEnd(const char *CurPtr, const char *BufferEnd, in FindConflictEnd() argument
2613 auto RestOfBuffer = StringRef(CurPtr, BufferEnd - CurPtr).substr(TermLen); in FindConflictEnd()
2632 bool Lexer::IsStartOfConflictMarker(const char *CurPtr) { in IsStartOfConflictMarker() argument
2634 if (CurPtr != BufferStart && in IsStartOfConflictMarker()
2635 CurPtr[-1] != '\n' && CurPtr[-1] != '\r') in IsStartOfConflictMarker()
2639 if (!StringRef(CurPtr, BufferEnd - CurPtr).startswith("<<<<<<<") && in IsStartOfConflictMarker()
2640 !StringRef(CurPtr, BufferEnd - CurPtr).startswith(">>>> ")) in IsStartOfConflictMarker()
2648 ConflictMarkerKind Kind = *CurPtr == '<' ? CMK_Normal : CMK_Perforce; in IsStartOfConflictMarker()
2652 if (FindConflictEnd(CurPtr, BufferEnd, Kind)) { in IsStartOfConflictMarker()
2655 Diag(CurPtr, diag::err_conflict_marker); in IsStartOfConflictMarker()
2660 while (*CurPtr != '\r' && *CurPtr != '\n') { in IsStartOfConflictMarker()
2661 assert(CurPtr != BufferEnd && "Didn't find end of line"); in IsStartOfConflictMarker()
2662 ++CurPtr; in IsStartOfConflictMarker()
2664 BufferPtr = CurPtr; in IsStartOfConflictMarker()
2677 bool Lexer::HandleEndOfConflictMarker(const char *CurPtr) { in HandleEndOfConflictMarker() argument
2679 if (CurPtr != BufferStart && in HandleEndOfConflictMarker()
2680 CurPtr[-1] != '\n' && CurPtr[-1] != '\r') in HandleEndOfConflictMarker()
2690 if (CurPtr[i] != CurPtr[0]) in HandleEndOfConflictMarker()
2696 if (const char *End = FindConflictEnd(CurPtr, BufferEnd, in HandleEndOfConflictMarker()
2698 CurPtr = End; in HandleEndOfConflictMarker()
2701 while (CurPtr != BufferEnd && *CurPtr != '\r' && *CurPtr != '\n') in HandleEndOfConflictMarker()
2702 ++CurPtr; in HandleEndOfConflictMarker()
2704 BufferPtr = CurPtr; in HandleEndOfConflictMarker()
2714 bool Lexer::isCodeCompletionPoint(const char *CurPtr) const { in isCodeCompletionPoint()
2716 SourceLocation Loc = FileLoc.getLocWithOffset(CurPtr-BufferStart); in isCodeCompletionPoint()
2742 const char *CurPtr = StartPtr + CharSize; in tryReadUCN() local
2743 const char *KindLoc = &CurPtr[-1]; in tryReadUCN()
2747 char C = getCharAndSize(CurPtr, CharSize); in tryReadUCN()
2773 CurPtr += CharSize; in tryReadUCN()
2778 if (CurPtr - StartPtr == (ptrdiff_t)NumHexDigits + 2) in tryReadUCN()
2779 StartPtr = CurPtr; in tryReadUCN()
2781 while (StartPtr != CurPtr) in tryReadUCN()
2784 StartPtr = CurPtr; in tryReadUCN()
2836 const char *CurPtr) { in CheckUnicodeWhitespace() argument
2842 << makeCharRange(*this, BufferPtr, CurPtr); in CheckUnicodeWhitespace()
2850 bool Lexer::LexUnicode(Token &Result, uint32_t C, const char *CurPtr) { in LexUnicode() argument
2855 makeCharRange(*this, BufferPtr, CurPtr), in LexUnicode()
2860 return LexIdentifier(Result, CurPtr); in LexUnicode()
2876 << FixItHint::CreateRemoval(makeCharRange(*this, BufferPtr, CurPtr)); in LexUnicode()
2878 BufferPtr = CurPtr; in LexUnicode()
2885 FormTokenWithChars(Result, CurPtr, tok::unknown); in LexUnicode()
2938 const char *CurPtr = BufferPtr; in LexTokenInternal() local
2941 if ((*CurPtr == ' ') || (*CurPtr == '\t')) { in LexTokenInternal()
2942 ++CurPtr; in LexTokenInternal()
2943 while ((*CurPtr == ' ') || (*CurPtr == '\t')) in LexTokenInternal()
2944 ++CurPtr; in LexTokenInternal()
2950 FormTokenWithChars(Result, CurPtr, tok::unknown); in LexTokenInternal()
2955 BufferPtr = CurPtr; in LexTokenInternal()
2962 char Char = getAndAdvanceChar(CurPtr, Result); in LexTokenInternal()
2968 if (CurPtr-1 == BufferEnd) in LexTokenInternal()
2969 return LexEndOfFile(Result, CurPtr-1); in LexTokenInternal()
2972 if (isCodeCompletionPoint(CurPtr-1)) { in LexTokenInternal()
2975 FormTokenWithChars(Result, CurPtr, tok::code_completion); in LexTokenInternal()
2980 Diag(CurPtr-1, diag::null_in_file); in LexTokenInternal()
2982 if (SkipWhitespace(Result, CurPtr, TokAtPhysicalStartOfLine)) in LexTokenInternal()
2993 Diag(CurPtr-1, diag::ext_ctrl_z_eof_microsoft); in LexTokenInternal()
2994 return LexEndOfFile(Result, CurPtr-1); in LexTokenInternal()
3024 if (SkipWhitespace(Result, CurPtr, TokAtPhysicalStartOfLine)) in LexTokenInternal()
3036 if (SkipWhitespace(Result, CurPtr, TokAtPhysicalStartOfLine)) in LexTokenInternal()
3040 CurPtr = BufferPtr; in LexTokenInternal()
3044 if (CurPtr[0] == '/' && CurPtr[1] == '/' && !inKeepCommentMode() && in LexTokenInternal()
3047 if (SkipLineComment(Result, CurPtr+2, TokAtPhysicalStartOfLine)) in LexTokenInternal()
3050 } else if (CurPtr[0] == '/' && CurPtr[1] == '*' && !inKeepCommentMode()) { in LexTokenInternal()
3051 if (SkipBlockComment(Result, CurPtr+2, TokAtPhysicalStartOfLine)) in LexTokenInternal()
3054 } else if (isHorizontalWhitespace(*CurPtr)) { in LexTokenInternal()
3067 return LexNumericConstant(Result, CurPtr); in LexTokenInternal()
3074 Char = getCharAndSize(CurPtr, SizeTmp); in LexTokenInternal()
3078 return LexStringLiteral(Result, ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3083 return LexCharConstant(Result, ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3088 getCharAndSize(CurPtr + SizeTmp, SizeTmp2) == '"') in LexTokenInternal()
3090 ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3095 char Char2 = getCharAndSize(CurPtr + SizeTmp, SizeTmp2); in LexTokenInternal()
3100 ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3105 Result, ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3111 char Char3 = getCharAndSize(CurPtr + SizeTmp + SizeTmp2, SizeTmp3); in LexTokenInternal()
3115 ConsumeChar(ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3125 return LexIdentifier(Result, CurPtr); in LexTokenInternal()
3132 Char = getCharAndSize(CurPtr, SizeTmp); in LexTokenInternal()
3136 return LexStringLiteral(Result, ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3141 return LexCharConstant(Result, ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3146 getCharAndSize(CurPtr + SizeTmp, SizeTmp2) == '"') in LexTokenInternal()
3148 ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3154 return LexIdentifier(Result, CurPtr); in LexTokenInternal()
3161 Char = getCharAndSize(CurPtr, SizeTmp); in LexTokenInternal()
3165 ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3170 return LexIdentifier(Result, CurPtr); in LexTokenInternal()
3175 Char = getCharAndSize(CurPtr, SizeTmp); in LexTokenInternal()
3179 return LexStringLiteral(Result, ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3184 getCharAndSize(CurPtr + SizeTmp, SizeTmp2) == '"') in LexTokenInternal()
3186 ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3192 return LexCharConstant(Result, ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3208 return LexIdentifier(Result, CurPtr); in LexTokenInternal()
3213 Diag(CurPtr-1, diag::ext_dollar_in_identifier); in LexTokenInternal()
3216 return LexIdentifier(Result, CurPtr); in LexTokenInternal()
3226 return LexCharConstant(Result, CurPtr, tok::char_constant); in LexTokenInternal()
3232 return LexStringLiteral(Result, CurPtr, tok::string_literal); in LexTokenInternal()
3257 Char = getCharAndSize(CurPtr, SizeTmp); in LexTokenInternal()
3262 return LexNumericConstant(Result, ConsumeChar(CurPtr, SizeTmp, Result)); in LexTokenInternal()
3265 CurPtr += SizeTmp; in LexTokenInternal()
3267 getCharAndSize(CurPtr+SizeTmp, SizeTmp2) == '.') { in LexTokenInternal()
3269 CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3276 Char = getCharAndSize(CurPtr, SizeTmp); in LexTokenInternal()
3279 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3282 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3288 if (getCharAndSize(CurPtr, SizeTmp) == '=') { in LexTokenInternal()
3290 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3296 Char = getCharAndSize(CurPtr, SizeTmp); in LexTokenInternal()
3298 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3301 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3308 Char = getCharAndSize(CurPtr, SizeTmp); in LexTokenInternal()
3310 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3313 getCharAndSize(CurPtr+SizeTmp, SizeTmp2) == '*') { // C++ ->* in LexTokenInternal()
3314 CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3318 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3321 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3331 if (getCharAndSize(CurPtr, SizeTmp) == '=') { in LexTokenInternal()
3333 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3340 Char = getCharAndSize(CurPtr, SizeTmp); in LexTokenInternal()
3354 TreatAsComment = getCharAndSize(CurPtr+SizeTmp, SizeTmp2) != '*'; in LexTokenInternal()
3357 if (SkipLineComment(Result, ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3369 if (SkipBlockComment(Result, ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3379 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3386 Char = getCharAndSize(CurPtr, SizeTmp); in LexTokenInternal()
3389 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3392 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3394 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3395 Char = getCharAndSize(CurPtr, SizeTmp); in LexTokenInternal()
3396 if (Char == '%' && getCharAndSize(CurPtr+SizeTmp, SizeTmp2) == ':') { in LexTokenInternal()
3398 CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3401 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3420 Char = getCharAndSize(CurPtr, SizeTmp); in LexTokenInternal()
3422 return LexAngledStringLiteral(Result, CurPtr); in LexTokenInternal()
3424 char After = getCharAndSize(CurPtr+SizeTmp, SizeTmp2); in LexTokenInternal()
3427 CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3429 } else if (After == '<' && IsStartOfConflictMarker(CurPtr-1)) { in LexTokenInternal()
3433 } else if (After == '<' && HandleEndOfConflictMarker(CurPtr-1)) { in LexTokenInternal()
3439 CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3442 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3446 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3450 getCharAndSize(CurPtr + SizeTmp, SizeTmp2) == ':') { in LexTokenInternal()
3457 char After = getCharAndSize(CurPtr + SizeTmp + SizeTmp2, SizeTmp3); in LexTokenInternal()
3466 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3469 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3476 Char = getCharAndSize(CurPtr, SizeTmp); in LexTokenInternal()
3478 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3481 char After = getCharAndSize(CurPtr+SizeTmp, SizeTmp2); in LexTokenInternal()
3483 CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3486 } else if (After == '>' && IsStartOfConflictMarker(CurPtr-1)) { in LexTokenInternal()
3490 } else if (After == '>' && HandleEndOfConflictMarker(CurPtr-1)) { in LexTokenInternal()
3495 CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3498 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3507 Char = getCharAndSize(CurPtr, SizeTmp); in LexTokenInternal()
3509 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3512 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3519 Char = getCharAndSize(CurPtr, SizeTmp); in LexTokenInternal()
3522 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3525 if (CurPtr[1] == '|' && HandleEndOfConflictMarker(CurPtr-1)) in LexTokenInternal()
3528 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3534 Char = getCharAndSize(CurPtr, SizeTmp); in LexTokenInternal()
3537 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3540 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3549 Char = getCharAndSize(CurPtr, SizeTmp); in LexTokenInternal()
3552 if (CurPtr[1] == '=' && HandleEndOfConflictMarker(CurPtr-1)) in LexTokenInternal()
3556 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3565 Char = getCharAndSize(CurPtr, SizeTmp); in LexTokenInternal()
3568 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3573 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3588 if (CurPtr[-1] == '@' && LangOpts.ObjC1) in LexTokenInternal()
3596 if (uint32_t CodePoint = tryReadUCN(CurPtr, BufferPtr, &Result)) { in LexTokenInternal()
3597 if (CheckUnicodeWhitespace(Result, CodePoint, CurPtr)) { in LexTokenInternal()
3598 if (SkipWhitespace(Result, CurPtr, TokAtPhysicalStartOfLine)) in LexTokenInternal()
3606 return LexUnicode(Result, CodePoint, CurPtr); in LexTokenInternal()
3622 --CurPtr; in LexTokenInternal()
3624 llvm::convertUTF8Sequence((const UTF8 **)&CurPtr, in LexTokenInternal()
3629 if (CheckUnicodeWhitespace(Result, CodePoint, CurPtr)) { in LexTokenInternal()
3630 if (SkipWhitespace(Result, CurPtr, TokAtPhysicalStartOfLine)) in LexTokenInternal()
3637 return LexUnicode(Result, CodePoint, CurPtr); in LexTokenInternal()
3642 ++CurPtr; in LexTokenInternal()
3650 Diag(CurPtr, diag::err_invalid_utf8); in LexTokenInternal()
3652 BufferPtr = CurPtr+1; in LexTokenInternal()
3664 FormTokenWithChars(Result, CurPtr, Kind); in LexTokenInternal()
3670 FormTokenWithChars(Result, CurPtr, tok::hash); in LexTokenInternal()