Lines Matching refs:Result
203 std::string Result = Str; in Stringify() local
205 for (unsigned i = 0, e = Result.size(); i != e; ++i) { in Stringify()
206 if (Result[i] == '\\' || Result[i] == Quote) { in Stringify()
207 Result.insert(Result.begin()+i, '\\'); in Stringify()
211 return Result; in Stringify()
342 std::string Result; in getSpelling() local
343 Result.resize(Tok.getLength()); in getSpelling()
344 Result.resize(getSpellingSlow(Tok, TokStart, LangOpts, &*Result.begin())); in getSpelling()
345 return Result; in getSpelling()
417 bool Lexer::getRawToken(SourceLocation Loc, Token &Result, in getRawToken() argument
445 TheLexer.LexFromRawLexer(Result); in getRawToken()
1460 Token &Result) { in tryConsumeIdentifierUCN() argument
1471 Result.setFlag(Token::HasUCN); in tryConsumeIdentifierUCN()
1477 (void)getAndAdvanceChar(CurPtr, Result); in tryConsumeIdentifierUCN()
1484 ConversionResult Result = in tryConsumeIdentifierUTF8Char() local
1489 if (Result != conversionOK || in tryConsumeIdentifierUTF8Char()
1502 bool Lexer::LexIdentifier(Token &Result, const char *CurPtr) { in LexIdentifier() argument
1520 FormTokenWithChars(Result, CurPtr, tok::raw_identifier); in LexIdentifier()
1521 Result.setRawIdentifierData(IdStart); in LexIdentifier()
1530 IdentifierInfo *II = PP->LookUpIdentifierInfo(Result); in LexIdentifier()
1535 return PP->HandleIdentifier(Result); in LexIdentifier()
1551 CurPtr = ConsumeChar(CurPtr, Size, Result); in LexIdentifier()
1555 } else if (C == '\\' && tryConsumeIdentifierUCN(CurPtr, Size, Result)) { in LexIdentifier()
1566 CurPtr = ConsumeChar(CurPtr, Size, Result); in LexIdentifier()
1570 CurPtr = ConsumeChar(CurPtr, Size, Result); in LexIdentifier()
1590 bool Lexer::LexNumericConstant(Token &Result, const char *CurPtr) { in LexNumericConstant() argument
1595 CurPtr = ConsumeChar(CurPtr, Size, Result); in LexNumericConstant()
1605 return LexNumericConstant(Result, ConsumeChar(CurPtr, Size, Result)); in LexNumericConstant()
1622 return LexNumericConstant(Result, ConsumeChar(CurPtr, Size, Result)); 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()
1642 return LexNumericConstant(Result, CurPtr); in LexNumericConstant()
1646 FormTokenWithChars(Result, CurPtr, tok::numeric_constant); in LexNumericConstant()
1647 Result.setLiteralData(TokStart); in LexNumericConstant()
1653 const char *Lexer::LexUDSuffix(Token &Result, const char *CurPtr, in LexUDSuffix() argument
1663 if (C == '\\' && tryConsumeIdentifierUCN(CurPtr, Size, Result)) in LexUDSuffix()
1727 CurPtr = ConsumeChar(CurPtr, Size, Result); in LexUDSuffix()
1730 Result.setFlag(Token::HasUDSuffix); in LexUDSuffix()
1733 if (isIdentifierBody(C)) { CurPtr = ConsumeChar(CurPtr, Size, Result); } in LexUDSuffix()
1734 else if (C == '\\' && tryConsumeIdentifierUCN(CurPtr, Size, Result)) {} 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()
1768 FormTokenWithChars(Result, CurPtr-1, tok::unknown); in LexStringLiteral()
1775 FormTokenWithChars(Result, CurPtr-1, tok::unknown); in LexStringLiteral()
1782 C = getAndAdvanceChar(CurPtr, Result); in LexStringLiteral()
1787 CurPtr = LexUDSuffix(Result, CurPtr, true); in LexStringLiteral()
1795 FormTokenWithChars(Result, CurPtr, Kind); in LexStringLiteral()
1796 Result.setLiteralData(TokStart); in LexStringLiteral()
1802 bool Lexer::LexRawStringLiteral(Token &Result, const char *CurPtr, in LexRawStringLiteral() argument
1843 FormTokenWithChars(Result, CurPtr, tok::unknown); 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()
1876 Result.setLiteralData(TokStart); in LexRawStringLiteral()
1882 bool Lexer::LexAngledStringLiteral(Token &Result, const char *CurPtr) { in LexAngledStringLiteral() argument
1886 char C = getAndAdvanceChar(CurPtr, Result); in LexAngledStringLiteral()
1891 getAndAdvanceChar(CurPtr, Result); in LexAngledStringLiteral()
1897 FormTokenWithChars(Result, AfterLessPos, tok::less); in LexAngledStringLiteral()
1902 C = getAndAdvanceChar(CurPtr, Result); in LexAngledStringLiteral()
1911 FormTokenWithChars(Result, CurPtr, tok::angle_string_literal); in LexAngledStringLiteral()
1912 Result.setLiteralData(TokStart); 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()
1950 FormTokenWithChars(Result, CurPtr-1, tok::unknown); in LexCharConstant()
1957 FormTokenWithChars(Result, CurPtr-1, tok::unknown); in LexCharConstant()
1964 C = getAndAdvanceChar(CurPtr, Result); in LexCharConstant()
1969 CurPtr = LexUDSuffix(Result, CurPtr, false); in LexCharConstant()
1977 FormTokenWithChars(Result, CurPtr, Kind); in LexCharConstant()
1978 Result.setLiteralData(TokStart); in LexCharConstant()
1987 bool Lexer::SkipWhitespace(Token &Result, const char *CurPtr, in SkipWhitespace() argument
2017 FormTokenWithChars(Result, CurPtr, tok::unknown); in SkipWhitespace()
2030 Result.setFlagValue(Token::LeadingSpace, HasLeadingSpace); in SkipWhitespace()
2032 Result.setFlag(Token::StartOfLine); in SkipWhitespace()
2046 bool Lexer::SkipLineComment(Token &Result, const char *CurPtr, in SkipLineComment() argument
2099 C = getAndAdvanceChar(CurPtr, Result); in SkipLineComment()
2147 PP->HandleComment(Result, SourceRange(getSourceLocation(BufferPtr), in SkipLineComment()
2155 return SaveLineComment(Result, CurPtr); in SkipLineComment()
2172 Result.setFlag(Token::StartOfLine); in SkipLineComment()
2175 Result.clearFlag(Token::LeadingSpace); in SkipLineComment()
2182 bool Lexer::SaveLineComment(Token &Result, const char *CurPtr) { in SaveLineComment() argument
2185 FormTokenWithChars(Result, CurPtr, tok::comment); in SaveLineComment()
2193 std::string Spelling = PP->getSpelling(Result, &Invalid); in SaveLineComment()
2201 Result.setKind(tok::comment); in SaveLineComment()
2202 PP->CreateString(Spelling, Result, in SaveLineComment()
2203 Result.getLocation(), Result.getLocation()); in SaveLineComment()
2284 bool Lexer::SkipBlockComment(Token &Result, const char *CurPtr, in SkipBlockComment() argument
2305 FormTokenWithChars(Result, CurPtr, tok::unknown); in SkipBlockComment()
2402 FormTokenWithChars(Result, CurPtr, tok::unknown); in SkipBlockComment()
2419 PP->HandleComment(Result, SourceRange(getSourceLocation(BufferPtr), in SkipBlockComment()
2427 FormTokenWithChars(Result, CurPtr, tok::comment); in SkipBlockComment()
2436 SkipWhitespace(Result, CurPtr+1, TokAtPhysicalStartOfLine); in SkipBlockComment()
2442 Result.setFlag(Token::LeadingSpace); in SkipBlockComment()
2452 void Lexer::ReadToEndOfLine(SmallVectorImpl<char> *Result) { in ReadToEndOfLine() argument
2463 if (Result) in ReadToEndOfLine()
2464 Result->push_back(Char); in ReadToEndOfLine()
2476 if (Result) in ReadToEndOfLine()
2477 Result->push_back(Char); in ReadToEndOfLine()
2506 bool Lexer::LexEndOfFile(Token &Result, const char *CurPtr) { in LexEndOfFile() argument
2514 FormTokenWithChars(Result, CurPtr, tok::eod); in LexEndOfFile()
2525 Result.startToken(); in LexEndOfFile()
2527 FormTokenWithChars(Result, BufferEnd, tok::eof); in LexEndOfFile()
2568 return PP->HandleEndOfFile(Result, isPragmaLexer()); in LexEndOfFile()
2724 Token *Result) { in tryReadUCN() argument
2737 if (Result && !isLexingRawMode()) in tryReadUCN()
2751 if (Result && !isLexingRawMode()) { in tryReadUCN()
2776 if (Result) { in tryReadUCN()
2777 Result->setFlag(Token::HasUCN); in tryReadUCN()
2782 (void)getAndAdvanceChar(StartPtr, *Result); in tryReadUCN()
2808 if (Result && PP) { in tryReadUCN()
2823 if (Result && PP) { in tryReadUCN()
2835 bool Lexer::CheckUnicodeWhitespace(Token &Result, uint32_t C, in CheckUnicodeWhitespace() argument
2844 Result.setFlag(Token::LeadingSpace); in CheckUnicodeWhitespace()
2850 bool Lexer::LexUnicode(Token &Result, uint32_t C, const char *CurPtr) { in LexUnicode() argument
2860 return LexIdentifier(Result, CurPtr); in LexUnicode()
2885 FormTokenWithChars(Result, CurPtr, tok::unknown); in LexUnicode()
2889 void Lexer::PropagateLineStartLeadingSpaceInfo(Token &Result) { in PropagateLineStartLeadingSpaceInfo() argument
2890 IsAtStartOfLine = Result.isAtStartOfLine(); in PropagateLineStartLeadingSpaceInfo()
2891 HasLeadingSpace = Result.hasLeadingSpace(); in PropagateLineStartLeadingSpaceInfo()
2892 HasLeadingEmptyMacro = Result.hasLeadingEmptyMacro(); in PropagateLineStartLeadingSpaceInfo()
2896 bool Lexer::Lex(Token &Result) { in Lex() argument
2898 Result.startToken(); in Lex()
2902 Result.setFlag(Token::StartOfLine); in Lex()
2907 Result.setFlag(Token::LeadingSpace); in Lex()
2912 Result.setFlag(Token::LeadingEmptyMacro); in Lex()
2920 bool returnedToken = LexTokenInternal(Result, atPhysicalStartOfLine); in Lex()
2931 bool Lexer::LexTokenInternal(Token &Result, bool TokAtPhysicalStartOfLine) { in LexTokenInternal() argument
2934 Result.clearFlag(Token::NeedsCleaning); in LexTokenInternal()
2935 Result.setIdentifierInfo(nullptr); in LexTokenInternal()
2950 FormTokenWithChars(Result, CurPtr, tok::unknown); in LexTokenInternal()
2956 Result.setFlag(Token::LeadingSpace); in LexTokenInternal()
2962 char Char = getAndAdvanceChar(CurPtr, Result); in LexTokenInternal()
2969 return LexEndOfFile(Result, CurPtr-1); in LexTokenInternal()
2974 Result.startToken(); in LexTokenInternal()
2975 FormTokenWithChars(Result, CurPtr, tok::code_completion); in LexTokenInternal()
2981 Result.setFlag(Token::LeadingSpace); in LexTokenInternal()
2982 if (SkipWhitespace(Result, CurPtr, TokAtPhysicalStartOfLine)) in LexTokenInternal()
2994 return LexEndOfFile(Result, CurPtr-1); in LexTokenInternal()
3022 Result.clearFlag(Token::LeadingSpace); in LexTokenInternal()
3024 if (SkipWhitespace(Result, CurPtr, TokAtPhysicalStartOfLine)) in LexTokenInternal()
3035 Result.setFlag(Token::LeadingSpace); in LexTokenInternal()
3036 if (SkipWhitespace(Result, CurPtr, TokAtPhysicalStartOfLine)) in LexTokenInternal()
3047 if (SkipLineComment(Result, CurPtr+2, TokAtPhysicalStartOfLine)) in LexTokenInternal()
3051 if (SkipBlockComment(Result, CurPtr+2, TokAtPhysicalStartOfLine)) in LexTokenInternal()
3067 return LexNumericConstant(Result, CurPtr); in LexTokenInternal()
3078 return LexStringLiteral(Result, ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3083 return LexCharConstant(Result, ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3089 return LexRawStringLiteral(Result, in LexTokenInternal()
3090 ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3091 SizeTmp2, Result), in LexTokenInternal()
3099 return LexStringLiteral(Result, in LexTokenInternal()
3100 ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3101 SizeTmp2, Result), in LexTokenInternal()
3105 Result, ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3106 SizeTmp2, Result), in LexTokenInternal()
3114 return LexRawStringLiteral(Result, in LexTokenInternal()
3115 ConsumeChar(ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3116 SizeTmp2, Result), in LexTokenInternal()
3117 SizeTmp3, Result), in LexTokenInternal()
3125 return LexIdentifier(Result, CurPtr); in LexTokenInternal()
3136 return LexStringLiteral(Result, ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3141 return LexCharConstant(Result, ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3147 return LexRawStringLiteral(Result, in LexTokenInternal()
3148 ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3149 SizeTmp2, Result), in LexTokenInternal()
3154 return LexIdentifier(Result, CurPtr); in LexTokenInternal()
3164 return LexRawStringLiteral(Result, in LexTokenInternal()
3165 ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3170 return LexIdentifier(Result, CurPtr); in LexTokenInternal()
3179 return LexStringLiteral(Result, ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3185 return LexRawStringLiteral(Result, in LexTokenInternal()
3186 ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3187 SizeTmp2, Result), in LexTokenInternal()
3192 return LexCharConstant(Result, ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3208 return LexIdentifier(Result, CurPtr); 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()
3262 return LexNumericConstant(Result, ConsumeChar(CurPtr, SizeTmp, Result)); in LexTokenInternal()
3269 CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3270 SizeTmp2, Result); in LexTokenInternal()
3279 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3282 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3290 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3298 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3301 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3310 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3314 CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3315 SizeTmp2, Result); in LexTokenInternal()
3318 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3321 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3333 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); 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()
3389 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3392 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3394 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3398 CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3399 SizeTmp2, Result); in LexTokenInternal()
3401 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3422 return LexAngledStringLiteral(Result, CurPtr); in LexTokenInternal()
3427 CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3428 SizeTmp2, Result); in LexTokenInternal()
3439 CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3440 SizeTmp2, Result); in LexTokenInternal()
3442 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3446 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3466 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3469 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3478 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3483 CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3484 SizeTmp2, Result); in LexTokenInternal()
3495 CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), in LexTokenInternal()
3496 SizeTmp2, Result); in LexTokenInternal()
3498 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3509 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3512 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3522 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3528 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3537 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3540 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3556 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3568 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); in LexTokenInternal()
3573 CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); 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()
3629 if (CheckUnicodeWhitespace(Result, CodePoint, CurPtr)) { in LexTokenInternal()
3630 if (SkipWhitespace(Result, CurPtr, TokAtPhysicalStartOfLine)) in LexTokenInternal()
3637 return LexUnicode(Result, CodePoint, CurPtr); in LexTokenInternal()
3664 FormTokenWithChars(Result, CurPtr, Kind); in LexTokenInternal()
3670 FormTokenWithChars(Result, CurPtr, tok::hash); in LexTokenInternal()
3671 PP->HandleDirective(Result); in LexTokenInternal()
3675 assert(Result.is(tok::eof) && "Preprocessor did not set tok:eof"); in LexTokenInternal()