Lines Matching refs:CurPtr
560 const char *CurPtr = Buffer.begin();
562 while (CurPtr != Buffer.end()) {
563 char ch = *CurPtr++;
570 if (CurPtr != Buffer.end())
571 MaxLineOffset = CurPtr - Buffer.begin();
1432 bool Lexer::tryConsumeIdentifierUCN(const char *&CurPtr, unsigned Size,
1434 const char *UCNPtr = CurPtr + Size;
1435 uint32_t CodePoint = tryReadUCN(UCNPtr, CurPtr, /*Token=*/nullptr);
1441 makeCharRange(*this, CurPtr, UCNPtr),
1445 if ((UCNPtr - CurPtr == 6 && CurPtr[1] == 'u') ||
1446 (UCNPtr - CurPtr == 10 && CurPtr[1] == 'U'))
1447 CurPtr = UCNPtr;
1449 while (CurPtr != UCNPtr)
1450 (void)getAndAdvanceChar(CurPtr, Result);
1454 bool Lexer::tryConsumeIdentifierUTF8Char(const char *&CurPtr) {
1455 const char *UnicodePtr = CurPtr;
1468 makeCharRange(*this, CurPtr, UnicodePtr),
1471 CurPtr = UnicodePtr;
1475 bool Lexer::LexIdentifier(Token &Result, const char *CurPtr) {
1478 unsigned char C = *CurPtr++;
1480 C = *CurPtr++;
1482 --CurPtr; // Back up over the skipped character.
1493 FormTokenWithChars(Result, CurPtr, tok::raw_identifier);
1515 C = getCharAndSize(CurPtr, Size);
1523 Diag(CurPtr, diag::ext_dollar_in_identifier);
1524 CurPtr = ConsumeChar(CurPtr, Size, Result);
1525 C = getCharAndSize(CurPtr, Size);
1528 } else if (C == '\\' && tryConsumeIdentifierUCN(CurPtr, Size, Result)) {
1529 C = getCharAndSize(CurPtr, Size);
1531 } else if (!isASCII(C) && tryConsumeIdentifierUTF8Char(CurPtr)) {
1532 C = getCharAndSize(CurPtr, Size);
1539 CurPtr = ConsumeChar(CurPtr, Size, Result);
1541 C = getCharAndSize(CurPtr, Size);
1543 CurPtr = ConsumeChar(CurPtr, Size, Result);
1544 C = getCharAndSize(CurPtr, Size);
1563 bool Lexer::LexNumericConstant(Token &Result, const char *CurPtr) {
1565 char C = getCharAndSize(CurPtr, Size);
1568 CurPtr = ConsumeChar(CurPtr, Size, Result);
1570 C = getCharAndSize(CurPtr, Size);
1578 return LexNumericConstant(Result, ConsumeChar(CurPtr, Size, Result));
1590 else if (std::find(BufferPtr, CurPtr, '_') != CurPtr)
1594 return LexNumericConstant(Result, ConsumeChar(CurPtr, Size, Result));
1600 char Next = getCharAndSizeNoWarn(CurPtr + Size, NextSize, getLangOpts());
1603 Diag(CurPtr, diag::warn_cxx11_compat_digit_separator);
1604 CurPtr = ConsumeChar(CurPtr, Size, Result);
1605 CurPtr = ConsumeChar(CurPtr, NextSize, Result);
1606 return LexNumericConstant(Result, CurPtr);
1611 if (C == '\\' && tryConsumeIdentifierUCN(CurPtr, Size, Result))
1612 return LexNumericConstant(Result, CurPtr);
1613 if (!isASCII(C) && tryConsumeIdentifierUTF8Char(CurPtr))
1614 return LexNumericConstant(Result, CurPtr);
1618 FormTokenWithChars(Result, CurPtr, tok::numeric_constant);
1625 const char *Lexer::LexUDSuffix(Token &Result, const char *CurPtr,
1631 char C = getCharAndSize(CurPtr, Size);
1635 if (C == '\\' && tryConsumeIdentifierUCN(CurPtr, Size, Result))
1637 else if (!isASCII(C) && tryConsumeIdentifierUTF8Char(CurPtr))
1640 return CurPtr;
1645 Diag(CurPtr,
1648 << FixItHint::CreateInsertion(getSourceLocation(CurPtr), " ");
1649 return CurPtr;
1671 char Next = getCharAndSizeNoWarn(CurPtr + Consumed, NextSize,
1692 Diag(CurPtr, getLangOpts().MSVCCompat
1695 << FixItHint::CreateInsertion(getSourceLocation(CurPtr), " ");
1696 return CurPtr;
1699 CurPtr = ConsumeChar(CurPtr, Size, Result);
1704 C = getCharAndSize(CurPtr, Size);
1705 if (isIdentifierBody(C)) { CurPtr = ConsumeChar(CurPtr, Size, Result); }
1706 else if (C == '\\' && tryConsumeIdentifierUCN(CurPtr, Size, Result)) {}
1707 else if (!isASCII(C) && tryConsumeIdentifierUTF8Char(CurPtr)) {}
1711 return CurPtr;
1716 bool Lexer::LexStringLiteral(Token &Result, const char *CurPtr,
1729 char C = getAndAdvanceChar(CurPtr, Result);
1734 C = getAndAdvanceChar(CurPtr, Result);
1737 (C == 0 && CurPtr-1 == BufferEnd)) { // End of file.
1740 FormTokenWithChars(Result, CurPtr-1, tok::unknown);
1745 if (isCodeCompletionPoint(CurPtr-1)) {
1747 FormTokenWithChars(Result, CurPtr-1, tok::unknown);
1752 NulCharacter = CurPtr-1;
1754 C = getAndAdvanceChar(CurPtr, Result);
1759 CurPtr = LexUDSuffix(Result, CurPtr, true);
1767 CurPtr, Kind);
1774 bool Lexer::LexRawStringLiteral(Token &Result, const char *CurPtr,
1786 while (PrefixLen != 16 && isRawStringDelimBody(CurPtr[PrefixLen]))
1790 if (CurPtr[PrefixLen] != '(') {
1792 const char *PrefixEnd = &CurPtr[PrefixLen];
1805 char C = *CurPtr++;
1809 if (C == 0 && CurPtr-1 == BufferEnd) {
1810 --CurPtr;
1815 FormTokenWithChars(Result, CurPtr, tok::unknown);
1819 // Save prefix and move CurPtr past it
1820 const char *Prefix = CurPtr;
1821 CurPtr += PrefixLen + 1; // skip over prefix and '('
1824 char C = *CurPtr++;
1828 if (strncmp(CurPtr, Prefix, PrefixLen) == 0 && CurPtr[PrefixLen] == '"') {
1829 CurPtr += PrefixLen + 1; // skip over prefix and '"'
1832 } else if (C == 0 && CurPtr-1 == BufferEnd) { // End of file.
1836 FormTokenWithChars(Result, CurPtr-1, tok::unknown);
1843 CurPtr = LexUDSuffix(Result, CurPtr, true);
1847 FormTokenWithChars(Result, CurPtr, Kind);
1854 bool Lexer::LexAngledStringLiteral(Token &Result, const char *CurPtr) {
1857 const char *AfterLessPos = CurPtr;
1858 char C = getAndAdvanceChar(CurPtr, Result);
1861 if (C == '\\' && CurPtr < BufferEnd) {
1863 getAndAdvanceChar(CurPtr, Result);
1865 (C == 0 && (CurPtr-1 == BufferEnd || // End of file.
1866 isCodeCompletionPoint(CurPtr-1)))) {
1872 NulCharacter = CurPtr-1;
1874 C = getAndAdvanceChar(CurPtr, Result);
1883 FormTokenWithChars(Result, CurPtr, tok::angle_string_literal);
1891 bool Lexer::LexCharConstant(Token &Result, const char *CurPtr,
1905 char C = getAndAdvanceChar(CurPtr, Result);
1909 FormTokenWithChars(Result, CurPtr, tok::unknown);
1916 C = getAndAdvanceChar(CurPtr, Result);
1919 (C == 0 && CurPtr-1 == BufferEnd)) { // End of file.
1922 FormTokenWithChars(Result, CurPtr-1, tok::unknown);
1927 if (isCodeCompletionPoint(CurPtr-1)) {
1929 FormTokenWithChars(Result, CurPtr-1, tok::unknown);
1934 NulCharacter = CurPtr-1;
1936 C = getAndAdvanceChar(CurPtr, Result);
1941 CurPtr = LexUDSuffix(Result, CurPtr, false);
1949 FormTokenWithChars(Result, CurPtr, Kind);
1959 bool Lexer::SkipWhitespace(Token &Result, const char *CurPtr,
1962 bool SawNewline = isVerticalWhitespace(CurPtr[-1]);
1964 unsigned char Char = *CurPtr;
1970 Char = *++CurPtr;
1978 BufferPtr = CurPtr;
1984 Char = *++CurPtr;
1989 FormTokenWithChars(Result, CurPtr, tok::unknown);
1999 char PrevChar = CurPtr[-1];
2008 BufferPtr = CurPtr;
2018 bool Lexer::SkipLineComment(Token &Result, const char *CurPtr,
2035 C = *CurPtr;
2039 C = *++CurPtr;
2041 const char *NextLine = CurPtr;
2044 const char *EscapePtr = CurPtr-1;
2052 CurPtr = EscapePtr;
2055 CurPtr = EscapePtr-2;
2068 const char *OldPtr = CurPtr;
2071 C = getAndAdvanceChar(CurPtr, Result);
2076 if (C != 0 && CurPtr == OldPtr+1) {
2077 CurPtr = NextLine;
2084 if (CurPtr != OldPtr+1 && C != '/' && CurPtr[0] != '/') {
2085 for (; OldPtr != CurPtr; ++OldPtr)
2090 const char *ForwardPtr = CurPtr;
2103 if (CurPtr == BufferEnd+1) {
2104 --CurPtr;
2108 if (C == '\0' && isCodeCompletionPoint(CurPtr-1)) {
2120 getSourceLocation(CurPtr)))) {
2121 BufferPtr = CurPtr;
2127 return SaveLineComment(Result, CurPtr);
2131 if (ParsingPreprocessorDirective || CurPtr == BufferEnd) {
2132 BufferPtr = CurPtr;
2141 ++CurPtr;
2148 BufferPtr = CurPtr;
2154 bool Lexer::SaveLineComment(Token &Result, const char *CurPtr) {
2157 FormTokenWithChars(Result, CurPtr, tok::comment);
2182 static bool isEndOfBlockCommentWithEscapedNewLine(const char *CurPtr,
2184 assert(CurPtr[0] == '\n' || CurPtr[0] == '\r');
2187 --CurPtr;
2190 if (CurPtr[0] == '\n' || CurPtr[0] == '\r') {
2192 if (CurPtr[0] == CurPtr[1])
2195 --CurPtr;
2201 while (isHorizontalWhitespace(*CurPtr) || *CurPtr == 0) {
2202 --CurPtr;
2207 if (*CurPtr == '\\') {
2208 if (CurPtr[-1] != '*') return false;
2211 if (CurPtr[0] != '/' || CurPtr[-1] != '?' || CurPtr[-2] != '?' ||
2212 CurPtr[-3] != '*')
2216 CurPtr -= 2;
2222 L->Diag(CurPtr, diag::trigraph_ignored_block_comment);
2226 L->Diag(CurPtr, diag::trigraph_ends_block_comment);
2231 L->Diag(CurPtr, diag::escaped_newline_block_comment_end);
2235 L->Diag(CurPtr, diag::backslash_newline_space);
2256 bool Lexer::SkipBlockComment(Token &Result, const char *CurPtr,
2267 unsigned char C = getCharAndSize(CurPtr, CharSize);
2268 CurPtr += CharSize;
2269 if (C == 0 && CurPtr == BufferEnd+1) {
2272 --CurPtr;
2277 FormTokenWithChars(Result, CurPtr, tok::unknown);
2281 BufferPtr = CurPtr;
2288 C = *CurPtr++;
2293 if (CurPtr + 24 < BufferEnd &&
2298 while (C != '/' && ((intptr_t)CurPtr & 0x0F) != 0)
2299 C = *CurPtr++;
2305 while (CurPtr+16 <= BufferEnd) {
2306 int cmp = _mm_movemask_epi8(_mm_cmpeq_epi8(*(const __m128i*)CurPtr,
2312 CurPtr += llvm::countTrailingZeros<unsigned>(cmp) + 1;
2315 CurPtr += 16;
2322 while (CurPtr+16 <= BufferEnd &&
2323 !vec_any_eq(*(const vector unsigned char*)CurPtr, Slashes))
2324 CurPtr += 16;
2327 while (CurPtr[0] != '/' &&
2328 CurPtr[1] != '/' &&
2329 CurPtr[2] != '/' &&
2330 CurPtr[3] != '/' &&
2331 CurPtr+4 < BufferEnd) {
2332 CurPtr += 4;
2337 C = *CurPtr++;
2342 C = *CurPtr++;
2346 if (CurPtr[-2] == '*') // We found the final */. We're done!
2349 if ((CurPtr[-2] == '\n' || CurPtr[-2] == '\r')) {
2350 if (isEndOfBlockCommentWithEscapedNewLine(CurPtr-2, this)) {
2356 if (CurPtr[0] == '*' && CurPtr[1] != '/') {
2361 Diag(CurPtr-1, diag::warn_nested_block_comment);
2363 } else if (C == 0 && CurPtr == BufferEnd+1) {
2369 --CurPtr;
2374 FormTokenWithChars(Result, CurPtr, tok::unknown);
2378 BufferPtr = CurPtr;
2380 } else if (C == '\0' && isCodeCompletionPoint(CurPtr-1)) {
2386 C = *CurPtr++;
2392 getSourceLocation(CurPtr)))) {
2393 BufferPtr = CurPtr;
2399 FormTokenWithChars(Result, CurPtr, tok::comment);
2407 if (isHorizontalWhitespace(*CurPtr)) {
2408 SkipWhitespace(Result, CurPtr+1, TokAtPhysicalStartOfLine);
2413 BufferPtr = CurPtr;
2429 // CurPtr - Cache BufferPtr in an automatic variable.
2430 const char *CurPtr = BufferPtr;
2432 char Char = getAndAdvanceChar(CurPtr, Tmp);
2440 if (CurPtr-1 != BufferEnd) {
2441 if (isCodeCompletionPoint(CurPtr-1)) {
2456 assert(CurPtr[-1] == Char && "Trigraphs for newline?");
2457 BufferPtr = CurPtr-1;
2474 /// LexEndOfFile - CurPtr points to the end of this file. Handle this
2478 bool Lexer::LexEndOfFile(Token &Result, const char *CurPtr) {
2486 FormTokenWithChars(Result, CurPtr, tok::eod);
2515 if (CurPtr != BufferStart && (CurPtr[-1] != '\n' && CurPtr[-1] != '\r')) {
2537 BufferPtr = CurPtr;
2581 static const char *FindConflictEnd(const char *CurPtr, const char *BufferEnd,
2585 StringRef RestOfBuffer(CurPtr+TermLen, BufferEnd-CurPtr-TermLen);
2604 bool Lexer::IsStartOfConflictMarker(const char *CurPtr) {
2606 if (CurPtr != BufferStart &&
2607 CurPtr[-1] != '\n' && CurPtr[-1] != '\r')
2611 if ((BufferEnd-CurPtr < 8 || StringRef(CurPtr, 7) != "<<<<<<<") &&
2612 (BufferEnd-CurPtr < 6 || StringRef(CurPtr, 5) != ">>>> "))
2620 ConflictMarkerKind Kind = *CurPtr == '<' ? CMK_Normal : CMK_Perforce;
2624 if (FindConflictEnd(CurPtr, BufferEnd, Kind)) {
2627 Diag(CurPtr, diag::err_conflict_marker);
2632 while (*CurPtr != '\r' && *CurPtr != '\n') {
2633 assert(CurPtr != BufferEnd && "Didn't find end of line");
2634 ++CurPtr;
2636 BufferPtr = CurPtr;
2649 bool Lexer::HandleEndOfConflictMarker(const char *CurPtr) {
2651 if (CurPtr != BufferStart &&
2652 CurPtr[-1] != '\n' && CurPtr[-1] != '\r')
2662 if (CurPtr[i] != CurPtr[0])
2666 // fail if it got skipped with a '#if 0' or something. Note that CurPtr might
2668 if (const char *End = FindConflictEnd(CurPtr, BufferEnd,
2670 CurPtr = End;
2673 while (CurPtr != BufferEnd && *CurPtr != '\r' && *CurPtr != '\n')
2674 ++CurPtr;
2676 BufferPtr = CurPtr;
2686 bool Lexer::isCodeCompletionPoint(const char *CurPtr) const {
2688 SourceLocation Loc = FileLoc.getLocWithOffset(CurPtr-BufferStart);
2714 const char *CurPtr = StartPtr + CharSize;
2715 const char *KindLoc = &CurPtr[-1];
2719 char C = getCharAndSize(CurPtr, CharSize);
2745 CurPtr += CharSize;
2750 if (CurPtr - StartPtr == (ptrdiff_t)NumHexDigits + 2)
2751 StartPtr = CurPtr;
2753 while (StartPtr != CurPtr)
2756 StartPtr = CurPtr;
2808 const char *CurPtr) {
2814 << makeCharRange(*this, BufferPtr, CurPtr);
2822 bool Lexer::LexUnicode(Token &Result, uint32_t C, const char *CurPtr) {
2827 makeCharRange(*this, BufferPtr, CurPtr),
2832 return LexIdentifier(Result, CurPtr);
2848 << FixItHint::CreateRemoval(makeCharRange(*this, BufferPtr, CurPtr));
2850 BufferPtr = CurPtr;
2857 FormTokenWithChars(Result, CurPtr, tok::unknown);
2909 // CurPtr - Cache BufferPtr in an automatic variable.
2910 const char *CurPtr = BufferPtr;
2913 if ((*CurPtr == ' ') || (*CurPtr == '\t')) {
2914 ++CurPtr;
2915 while ((*CurPtr == ' ') || (*CurPtr == '\t'))
2916 ++CurPtr;
2922 FormTokenWithChars(Result, CurPtr, tok::unknown);
2927 BufferPtr = CurPtr;
2934 char Char = getAndAdvanceChar(CurPtr, Result);
2940 if (CurPtr-1 == BufferEnd)
2941 return LexEndOfFile(Result, CurPtr-1);
2944 if (isCodeCompletionPoint(CurPtr-1)) {
2947 FormTokenWithChars(Result, CurPtr, tok::code_completion);
2952 Diag(CurPtr-1, diag::null_in_file);
2954 if (SkipWhitespace(Result, CurPtr, TokAtPhysicalStartOfLine))
2964 return LexEndOfFile(Result, CurPtr-1);
2993 if (SkipWhitespace(Result, CurPtr, TokAtPhysicalStartOfLine))
3005 if (SkipWhitespace(Result, CurPtr, TokAtPhysicalStartOfLine))
3009 CurPtr = BufferPtr;
3013 if (CurPtr[0] == '/' && CurPtr[1] == '/' && !inKeepCommentMode() &&
3016 if (SkipLineComment(Result, CurPtr+2, TokAtPhysicalStartOfLine))
3019 } else if (CurPtr[0] == '/' && CurPtr[1] == '*' && !inKeepCommentMode()) {
3020 if (SkipBlockComment(Result, CurPtr+2, TokAtPhysicalStartOfLine))
3023 } else if (isHorizontalWhitespace(*CurPtr)) {
3036 return LexNumericConstant(Result, CurPtr);
3043 Char = getCharAndSize(CurPtr, SizeTmp);
3047 return LexStringLiteral(Result, ConsumeChar(CurPtr, SizeTmp, Result),
3052 return LexCharConstant(Result, ConsumeChar(CurPtr, SizeTmp, Result),
3057 getCharAndSize(CurPtr + SizeTmp, SizeTmp2) == '"')
3059 ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
3064 char Char2 = getCharAndSize(CurPtr + SizeTmp, SizeTmp2);
3069 ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
3074 Result, ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
3080 char Char3 = getCharAndSize(CurPtr + SizeTmp + SizeTmp2, SizeTmp3);
3084 ConsumeChar(ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
3094 return LexIdentifier(Result, CurPtr);
3101 Char = getCharAndSize(CurPtr, SizeTmp);
3105 return LexStringLiteral(Result, ConsumeChar(CurPtr, SizeTmp, Result),
3110 return LexCharConstant(Result, ConsumeChar(CurPtr, SizeTmp, Result),
3115 getCharAndSize(CurPtr + SizeTmp, SizeTmp2) == '"')
3117 ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
3123 return LexIdentifier(Result, CurPtr);
3130 Char = getCharAndSize(CurPtr, SizeTmp);
3134 ConsumeChar(CurPtr, SizeTmp, Result),
3139 return LexIdentifier(Result, CurPtr);
3144 Char = getCharAndSize(CurPtr, SizeTmp);
3148 return LexStringLiteral(Result, ConsumeChar(CurPtr, SizeTmp, Result),
3153 getCharAndSize(CurPtr + SizeTmp, SizeTmp2) == '"')
3155 ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
3161 return LexCharConstant(Result, ConsumeChar(CurPtr, SizeTmp, Result),
3177 return LexIdentifier(Result, CurPtr);
3182 Diag(CurPtr-1, diag::ext_dollar_in_identifier);
3185 return LexIdentifier(Result, CurPtr);
3195 return LexCharConstant(Result, CurPtr, tok::char_constant);
3201 return LexStringLiteral(Result, CurPtr, tok::string_literal);
3226 Char = getCharAndSize(CurPtr, SizeTmp);
3231 return LexNumericConstant(Result, ConsumeChar(CurPtr, SizeTmp, Result));
3234 CurPtr += SizeTmp;
3236 getCharAndSize(CurPtr+SizeTmp, SizeTmp2) == '.') {
3238 CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
3245 Char = getCharAndSize(CurPtr, SizeTmp);
3248 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3251 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3257 if (getCharAndSize(CurPtr, SizeTmp) == '=') {
3259 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3265 Char = getCharAndSize(CurPtr, SizeTmp);
3267 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3270 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3277 Char = getCharAndSize(CurPtr, SizeTmp);
3279 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3282 getCharAndSize(CurPtr+SizeTmp, SizeTmp2) == '*') { // C++ ->*
3283 CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
3287 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3290 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3300 if (getCharAndSize(CurPtr, SizeTmp) == '=') {
3302 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3309 Char = getCharAndSize(CurPtr, SizeTmp);
3323 TreatAsComment = getCharAndSize(CurPtr+SizeTmp, SizeTmp2) != '*';
3326 if (SkipLineComment(Result, ConsumeChar(CurPtr, SizeTmp, Result),
3338 if (SkipBlockComment(Result, ConsumeChar(CurPtr, SizeTmp, Result),
3348 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3355 Char = getCharAndSize(CurPtr, SizeTmp);
3358 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3361 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3363 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3364 Char = getCharAndSize(CurPtr, SizeTmp);
3365 if (Char == '%' && getCharAndSize(CurPtr+SizeTmp, SizeTmp2) == ':') {
3367 CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
3370 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3389 Char = getCharAndSize(CurPtr, SizeTmp);
3391 return LexAngledStringLiteral(Result, CurPtr);
3393 char After = getCharAndSize(CurPtr+SizeTmp, SizeTmp2);
3396 CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
3398 } else if (After == '<' && IsStartOfConflictMarker(CurPtr-1)) {
3402 } else if (After == '<' && HandleEndOfConflictMarker(CurPtr-1)) {
3408 CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
3411 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3415 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3419 getCharAndSize(CurPtr + SizeTmp, SizeTmp2) == ':') {
3426 char After = getCharAndSize(CurPtr + SizeTmp + SizeTmp2, SizeTmp3);
3435 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3438 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3445 Char = getCharAndSize(CurPtr, SizeTmp);
3447 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3450 char After = getCharAndSize(CurPtr+SizeTmp, SizeTmp2);
3452 CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
3455 } else if (After == '>' && IsStartOfConflictMarker(CurPtr-1)) {
3459 } else if (After == '>' && HandleEndOfConflictMarker(CurPtr-1)) {
3464 CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
3467 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3476 Char = getCharAndSize(CurPtr, SizeTmp);
3478 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3485 Char = getCharAndSize(CurPtr, SizeTmp);
3488 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3491 if (CurPtr[1] == '|' && HandleEndOfConflictMarker(CurPtr-1))
3494 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3500 Char = getCharAndSize(CurPtr, SizeTmp);
3503 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3506 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3515 Char = getCharAndSize(CurPtr, SizeTmp);
3518 if (CurPtr[1] == '=' && HandleEndOfConflictMarker(CurPtr-1))
3522 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3531 Char = getCharAndSize(CurPtr, SizeTmp);
3534 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3539 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
3554 if (CurPtr[-1] == '@' && LangOpts.ObjC1)
3562 if (uint32_t CodePoint = tryReadUCN(CurPtr, BufferPtr, &Result)) {
3563 if (CheckUnicodeWhitespace(Result, CodePoint, CurPtr)) {
3564 if (SkipWhitespace(Result, CurPtr, TokAtPhysicalStartOfLine))
3572 return LexUnicode(Result, CodePoint, CurPtr);
3586 // We can't just reset CurPtr to BufferPtr because BufferPtr may point to
3588 --CurPtr;
3590 llvm::convertUTF8Sequence((const UTF8 **)&CurPtr,
3595 if (CheckUnicodeWhitespace(Result, CodePoint, CurPtr)) {
3596 if (SkipWhitespace(Result, CurPtr, TokAtPhysicalStartOfLine))
3603 return LexUnicode(Result, CodePoint, CurPtr);
3608 ++CurPtr;
3616 Diag(CurPtr, diag::err_invalid_utf8);
3618 BufferPtr = CurPtr+1;
3630 FormTokenWithChars(Result, CurPtr, Kind);
3636 FormTokenWithChars(Result, CurPtr, tok::hash);