Lines Matching full:token

168 static Cursor lexName(Cursor C, MIToken &Token, MIToken::TokenKind Type,  in lexName()  argument
175 Token.reset(Type, String) in lexName()
180 Token.reset(MIToken::Error, Range.remaining()); in lexName()
185 Token.reset(Type, Range.upto(C)) in lexName()
293 static Cursor maybeLexIdentifier(Cursor C, MIToken &Token) { in maybeLexIdentifier() argument
300 Token.reset(getIdentifierKind(Identifier), Identifier) in maybeLexIdentifier()
305 static Cursor maybeLexMachineBasicBlock(Cursor C, MIToken &Token, in maybeLexMachineBasicBlock() argument
314 Token.reset(MIToken::Error, C.remaining()); in maybeLexMachineBasicBlock()
332 Token.reset(IsReference ? MIToken::MachineBasicBlock in maybeLexMachineBasicBlock()
340 static Cursor maybeLexIndex(Cursor C, MIToken &Token, StringRef Rule, in maybeLexIndex() argument
349 Token.reset(Kind, Range.upto(C)).setIntegerValue(APSInt(NumberRange.upto(C))); in maybeLexIndex()
353 static Cursor maybeLexIndexAndName(Cursor C, MIToken &Token, StringRef Rule, in maybeLexIndexAndName() argument
370 Token.reset(Kind, Range.upto(C)) in maybeLexIndexAndName()
376 static Cursor maybeLexJumpTableIndex(Cursor C, MIToken &Token) { in maybeLexJumpTableIndex() argument
377 return maybeLexIndex(C, Token, "%jump-table.", MIToken::JumpTableIndex); in maybeLexJumpTableIndex()
380 static Cursor maybeLexStackObject(Cursor C, MIToken &Token) { in maybeLexStackObject() argument
381 return maybeLexIndexAndName(C, Token, "%stack.", MIToken::StackObject); in maybeLexStackObject()
384 static Cursor maybeLexFixedStackObject(Cursor C, MIToken &Token) { in maybeLexFixedStackObject() argument
385 return maybeLexIndex(C, Token, "%fixed-stack.", MIToken::FixedStackObject); in maybeLexFixedStackObject()
388 static Cursor maybeLexConstantPoolItem(Cursor C, MIToken &Token) { in maybeLexConstantPoolItem() argument
389 return maybeLexIndex(C, Token, "%const.", MIToken::ConstantPoolItem); in maybeLexConstantPoolItem()
392 static Cursor maybeLexSubRegisterIndex(Cursor C, MIToken &Token, in maybeLexSubRegisterIndex() argument
397 return lexName(C, Token, MIToken::SubRegisterIndex, Rule.size(), in maybeLexSubRegisterIndex()
401 static Cursor maybeLexIRBlock(Cursor C, MIToken &Token, in maybeLexIRBlock() argument
407 return maybeLexIndex(C, Token, Rule, MIToken::IRBlock); in maybeLexIRBlock()
408 return lexName(C, Token, MIToken::NamedIRBlock, Rule.size(), ErrorCallback); in maybeLexIRBlock()
411 static Cursor maybeLexIRValue(Cursor C, MIToken &Token, in maybeLexIRValue() argument
417 return maybeLexIndex(C, Token, Rule, MIToken::IRValue); in maybeLexIRValue()
418 return lexName(C, Token, MIToken::NamedIRValue, Rule.size(), ErrorCallback); in maybeLexIRValue()
421 static Cursor maybeLexStringConstant(Cursor C, MIToken &Token, in maybeLexStringConstant() argument
425 return lexName(C, Token, MIToken::StringConstant, /*PrefixLength=*/0, in maybeLexStringConstant()
429 static Cursor lexVirtualRegister(Cursor C, MIToken &Token) { in lexVirtualRegister() argument
435 Token.reset(MIToken::VirtualRegister, Range.upto(C)) in lexVirtualRegister()
445 static Cursor lexNamedVirtualRegister(Cursor C, MIToken &Token) { in lexNamedVirtualRegister() argument
450 Token.reset(MIToken::NamedVirtualRegister, Range.upto(C)) in lexNamedVirtualRegister()
455 static Cursor maybeLexRegister(Cursor C, MIToken &Token, in maybeLexRegister() argument
462 return lexVirtualRegister(C, Token); in maybeLexRegister()
465 return lexNamedVirtualRegister(C, Token); in maybeLexRegister()
475 Token.reset(MIToken::NamedRegister, Range.upto(C)) in maybeLexRegister()
480 static Cursor maybeLexGlobalValue(Cursor C, MIToken &Token, in maybeLexGlobalValue() argument
485 return lexName(C, Token, MIToken::NamedGlobalValue, /*PrefixLength=*/1, in maybeLexGlobalValue()
492 Token.reset(MIToken::GlobalValue, Range.upto(C)) in maybeLexGlobalValue()
497 static Cursor maybeLexExternalSymbol(Cursor C, MIToken &Token, in maybeLexExternalSymbol() argument
501 return lexName(C, Token, MIToken::ExternalSymbol, /*PrefixLength=*/1, in maybeLexExternalSymbol()
505 static Cursor maybeLexMCSymbol(Cursor C, MIToken &Token, in maybeLexMCSymbol() argument
521 Token.reset(MIToken::Error, Start.remaining()); in maybeLexMCSymbol()
526 Token.reset(MIToken::MCSymbol, Start.upto(C)).setStringValue(String); in maybeLexMCSymbol()
535 Token.reset(MIToken::Error, Start.remaining()); in maybeLexMCSymbol()
542 Token.reset(MIToken::Error, Start.remaining()); in maybeLexMCSymbol()
547 Token.reset(MIToken::MCSymbol, Start.upto(R)) in maybeLexMCSymbol()
556 static Cursor lexFloatingPointLiteral(Cursor Range, Cursor C, MIToken &Token) { in lexFloatingPointLiteral() argument
568 Token.reset(MIToken::FloatingPointLiteral, Range.upto(C)); in lexFloatingPointLiteral()
572 static Cursor maybeLexHexadecimalLiteral(Cursor C, MIToken &Token) { in maybeLexHexadecimalLiteral() argument
588 Token.reset(MIToken::HexLiteral, Range.upto(C)); in maybeLexHexadecimalLiteral()
590 Token.reset(MIToken::FloatingPointLiteral, Range.upto(C)); in maybeLexHexadecimalLiteral()
594 static Cursor maybeLexNumericalLiteral(Cursor C, MIToken &Token) { in maybeLexNumericalLiteral() argument
602 return lexFloatingPointLiteral(Range, C, Token); in maybeLexNumericalLiteral()
604 Token.reset(MIToken::IntegerLiteral, StrVal).setIntegerValue(APSInt(StrVal)); in maybeLexNumericalLiteral()
619 static Cursor maybeLexExclaim(Cursor C, MIToken &Token, in maybeLexExclaim() argument
626 Token.reset(MIToken::exclaim, Range.upto(C)); in maybeLexExclaim()
632 Token.reset(getMetadataKeywordKind(StrVal), StrVal); in maybeLexExclaim()
633 if (Token.isError()) in maybeLexExclaim()
634 ErrorCallback(Token.location(), in maybeLexExclaim()
670 static Cursor maybeLexSymbol(Cursor C, MIToken &Token) { in maybeLexSymbol() argument
682 Token.reset(Kind, Range.upto(C)); in maybeLexSymbol()
686 static Cursor maybeLexNewline(Cursor C, MIToken &Token) { in maybeLexNewline() argument
691 Token.reset(MIToken::Newline, Range.upto(C)); in maybeLexNewline()
695 static Cursor maybeLexEscapedIRValue(Cursor C, MIToken &Token, in maybeLexEscapedIRValue() argument
707 Token.reset(MIToken::Error, Range.remaining()); in maybeLexEscapedIRValue()
714 Token.reset(MIToken::QuotedIRValue, Range.upto(C)).setStringValue(Value); in maybeLexEscapedIRValue()
718 StringRef llvm::lexMIToken(StringRef Source, MIToken &Token, in lexMIToken() argument
722 Token.reset(MIToken::Eof, C.remaining()); in lexMIToken()
728 if (Cursor R = maybeLexMachineBasicBlock(C, Token, ErrorCallback)) in lexMIToken()
730 if (Cursor R = maybeLexIdentifier(C, Token)) in lexMIToken()
732 if (Cursor R = maybeLexJumpTableIndex(C, Token)) in lexMIToken()
734 if (Cursor R = maybeLexStackObject(C, Token)) in lexMIToken()
736 if (Cursor R = maybeLexFixedStackObject(C, Token)) in lexMIToken()
738 if (Cursor R = maybeLexConstantPoolItem(C, Token)) in lexMIToken()
740 if (Cursor R = maybeLexSubRegisterIndex(C, Token, ErrorCallback)) in lexMIToken()
742 if (Cursor R = maybeLexIRBlock(C, Token, ErrorCallback)) in lexMIToken()
744 if (Cursor R = maybeLexIRValue(C, Token, ErrorCallback)) in lexMIToken()
746 if (Cursor R = maybeLexRegister(C, Token, ErrorCallback)) in lexMIToken()
748 if (Cursor R = maybeLexGlobalValue(C, Token, ErrorCallback)) in lexMIToken()
750 if (Cursor R = maybeLexExternalSymbol(C, Token, ErrorCallback)) in lexMIToken()
752 if (Cursor R = maybeLexMCSymbol(C, Token, ErrorCallback)) in lexMIToken()
754 if (Cursor R = maybeLexHexadecimalLiteral(C, Token)) in lexMIToken()
756 if (Cursor R = maybeLexNumericalLiteral(C, Token)) in lexMIToken()
758 if (Cursor R = maybeLexExclaim(C, Token, ErrorCallback)) in lexMIToken()
760 if (Cursor R = maybeLexSymbol(C, Token)) in lexMIToken()
762 if (Cursor R = maybeLexNewline(C, Token)) in lexMIToken()
764 if (Cursor R = maybeLexEscapedIRValue(C, Token, ErrorCallback)) in lexMIToken()
766 if (Cursor R = maybeLexStringConstant(C, Token, ErrorCallback)) in lexMIToken()
769 Token.reset(MIToken::Error, C.remaining()); in lexMIToken()