Lines Matching refs:Token
67 MIToken Token; member in __anon2f6128060111::MIParser
264 CurrentSource.data() + SkipChar, Token, in lex()
268 bool MIParser::error(const Twine &Msg) { return error(Token.location(), Msg); } in error()
305 if (Token.isNot(TokenKind)) in expectAndConsume()
312 if (Token.isNot(TokenKind)) in consumeIfPresent()
320 assert(Token.is(MIToken::MachineBasicBlockLabel)); in parseBasicBlockDefinition()
324 auto Loc = Token.location(); in parseBasicBlockDefinition()
325 auto Name = Token.stringValue(); in parseBasicBlockDefinition()
334 switch (Token.kind()) { in parseBasicBlockDefinition()
389 while (Token.is(MIToken::Newline)) in parseBasicBlockDefinitions()
391 if (Token.isErrorOrEOF()) in parseBasicBlockDefinitions()
392 return Token.isError(); in parseBasicBlockDefinitions()
393 if (Token.isNot(MIToken::MachineBasicBlockLabel)) in parseBasicBlockDefinitions()
402 if ((Token.is(MIToken::MachineBasicBlockLabel) && IsAfterNewline) || in parseBasicBlockDefinitions()
403 Token.isErrorOrEOF()) in parseBasicBlockDefinitions()
405 else if (Token.is(MIToken::MachineBasicBlockLabel)) in parseBasicBlockDefinitions()
413 if (Token.is(MIToken::lbrace)) in parseBasicBlockDefinitions()
415 if (Token.is(MIToken::rbrace)) { in parseBasicBlockDefinitions()
423 if (!Token.isError() && BraceDepth) in parseBasicBlockDefinitions()
425 } while (!Token.isErrorOrEOF()); in parseBasicBlockDefinitions()
426 return Token.isError(); in parseBasicBlockDefinitions()
430 assert(Token.is(MIToken::kw_liveins)); in parseBasicBlockLiveins()
434 if (Token.isNewlineOrEOF()) // Allow an empty list of liveins. in parseBasicBlockLiveins()
437 if (Token.isNot(MIToken::NamedRegister)) in parseBasicBlockLiveins()
449 assert(Token.is(MIToken::kw_successors)); in parseBasicBlockSuccessors()
453 if (Token.isNewlineOrEOF()) // Allow an empty list of successors. in parseBasicBlockSuccessors()
456 if (Token.isNot(MIToken::MachineBasicBlock)) in parseBasicBlockSuccessors()
464 if (Token.isNot(MIToken::IntegerLiteral)) in parseBasicBlockSuccessors()
480 assert(Token.is(MIToken::MachineBasicBlockLabel)); in parseBasicBlock()
483 while (Token.isNot(MIToken::rparen) && !Token.isErrorOrEOF()) in parseBasicBlock()
499 if (Token.is(MIToken::kw_successors)) { in parseBasicBlock()
502 } else if (Token.is(MIToken::kw_liveins)) { in parseBasicBlock()
509 if (!Token.isNewlineOrEOF()) in parseBasicBlock()
518 if (Token.is(MIToken::MachineBasicBlockLabel) || Token.is(MIToken::Eof)) in parseBasicBlock()
538 if (Token.is(MIToken::lbrace)) { in parseBasicBlock()
545 if (!Token.is(MIToken::Newline)) in parseBasicBlock()
549 assert(Token.isNewlineOrEOF() && "MI is not fully parsed"); in parseBasicBlock()
558 while (Token.is(MIToken::Newline)) in parseBasicBlocks()
560 if (Token.isErrorOrEOF()) in parseBasicBlocks()
561 return Token.isError(); in parseBasicBlocks()
564 assert(Token.is(MIToken::MachineBasicBlockLabel)); in parseBasicBlocks()
573 assert(Token.is(MIToken::MachineBasicBlockLabel) || Token.is(MIToken::Eof)); in parseBasicBlocks()
574 } while (Token.isNot(MIToken::Eof)); in parseBasicBlocks()
582 while (Token.isRegister() || Token.isRegisterFlag()) { in parse()
583 auto Loc = Token.location(); in parse()
588 ParsedMachineOperand(MO, Loc, Token.location(), TiedDefIdx)); in parse()
589 if (Token.isNot(MIToken::comma)) in parse()
597 if (Token.isError() || parseInstruction(OpCode, Flags)) in parse()
603 auto Loc = Token.location(); in parse()
609 while (!Token.isNewlineOrEOF() && Token.isNot(MIToken::kw_debug_location) && in parse()
610 Token.isNot(MIToken::coloncolon) && Token.isNot(MIToken::lbrace)) { in parse()
611 auto Loc = Token.location(); in parse()
616 ParsedMachineOperand(MO, Loc, Token.location(), TiedDefIdx)); in parse()
617 if (Token.isNewlineOrEOF() || Token.is(MIToken::coloncolon) || in parse()
618 Token.is(MIToken::lbrace)) in parse()
620 if (Token.isNot(MIToken::comma)) in parse()
626 if (Token.is(MIToken::kw_debug_location)) { in parse()
628 if (Token.isNot(MIToken::exclaim)) in parse()
638 if (Token.is(MIToken::coloncolon)) { in parse()
640 while (!Token.isNewlineOrEOF()) { in parse()
645 if (Token.isNewlineOrEOF()) in parse()
647 if (Token.isNot(MIToken::comma)) in parse()
680 if (Token.isNot(MIToken::MachineBasicBlock)) in parseStandaloneMBB()
685 if (Token.isNot(MIToken::Eof)) in parseStandaloneMBB()
693 if (Token.isNot(MIToken::NamedRegister)) in parseStandaloneNamedRegister()
698 if (Token.isNot(MIToken::Eof)) in parseStandaloneNamedRegister()
705 if (Token.isNot(MIToken::VirtualRegister)) in parseStandaloneVirtualRegister()
710 if (Token.isNot(MIToken::Eof)) in parseStandaloneVirtualRegister()
717 if (Token.isNot(MIToken::StackObject)) in parseStandaloneStackObject()
721 if (Token.isNot(MIToken::Eof)) in parseStandaloneStackObject()
728 if (Token.isNot(MIToken::exclaim)) in parseStandaloneMDNode()
732 if (Token.isNot(MIToken::Eof)) in parseStandaloneMDNode()
781 return error(Operands.empty() ? Token.location() : Operands.back().End, in verifyImplicitOperands()
790 if (Token.is(MIToken::kw_frame_setup)) { in parseInstruction()
794 if (Token.isNot(MIToken::Identifier)) in parseInstruction()
796 StringRef InstrName = Token.stringValue(); in parseInstruction()
804 switch (Token.kind()) { in parseRegister()
809 StringRef Name = Token.stringValue(); in parseRegister()
834 switch (Token.kind()) { in parseRegisterFlag()
868 return error("duplicate '" + Token.stringValue() + "' register flag"); in parseRegisterFlag()
874 assert(Token.is(MIToken::colon)); in parseSubRegisterIndex()
876 if (Token.isNot(MIToken::Identifier)) in parseSubRegisterIndex()
878 auto Name = Token.stringValue(); in parseSubRegisterIndex()
889 if (Token.isNot(MIToken::IntegerLiteral)) in parseRegisterTiedDefIndex()
900 if (Token.isNot(MIToken::IntegerLiteral)) in parseSize()
952 while (Token.isRegisterFlag()) { in parseRegisterOperand()
956 if (!Token.isRegister()) in parseRegisterOperand()
962 if (Token.is(MIToken::colon)) { in parseRegisterOperand()
998 assert(Token.is(MIToken::IntegerLiteral)); in parseImmediateOperand()
999 const APSInt &Int = Token.integerValue(); in parseImmediateOperand()
1019 if (parseIRConstant(Loc, StringRef(Loc, Token.range().end() - Loc), C)) in parseIRConstant()
1053 lex(Read - (Token.range().end() - Loc)); in parseIRType()
1058 assert(Token.is(MIToken::IntegerType)); in parseTypedImmediateOperand()
1059 auto Loc = Token.location(); in parseTypedImmediateOperand()
1061 if (Token.isNot(MIToken::IntegerLiteral)) in parseTypedImmediateOperand()
1071 auto Loc = Token.location(); in parseFPImmediateOperand()
1073 if (Token.isNot(MIToken::FloatingPointLiteral)) in parseFPImmediateOperand()
1083 assert(Token.hasIntegerValue() && "Expected a token with an integer value"); in getUnsigned()
1085 uint64_t Val64 = Token.integerValue().getLimitedValue(Limit); in getUnsigned()
1093 assert(Token.is(MIToken::MachineBasicBlock) || in parseMBBReference()
1094 Token.is(MIToken::MachineBasicBlockLabel)); in parseMBBReference()
1103 if (!Token.stringValue().empty() && Token.stringValue() != MBB->getName()) in parseMBBReference()
1105 " isn't '" + Token.stringValue() + "'"); in parseMBBReference()
1119 assert(Token.is(MIToken::StackObject)); in parseStackFrameIndex()
1131 if (!Token.stringValue().empty() && Token.stringValue() != Name) in parseStackFrameIndex()
1133 "' isn't '" + Token.stringValue() + "'"); in parseStackFrameIndex()
1148 assert(Token.is(MIToken::FixedStackObject)); in parseFixedStackFrameIndex()
1170 switch (Token.kind()) { in parseGlobalValue()
1173 GV = M->getNamedValue(Token.stringValue()); in parseGlobalValue()
1175 return error(Twine("use of undefined global value '") + Token.range() + in parseGlobalValue()
1207 assert(Token.is(MIToken::ConstantPoolItem)); in parseConstantPoolIndexOperand()
1222 assert(Token.is(MIToken::JumpTableIndex)); in parseJumpTableIndexOperand()
1235 assert(Token.is(MIToken::ExternalSymbol)); in parseExternalSymbolOperand()
1236 const char *Symbol = MF.createExternalSymbolName(Token.stringValue()); in parseExternalSymbolOperand()
1245 assert(Token.is(MIToken::SubRegisterIndex)); in parseSubRegisterIndexOperand()
1246 StringRef Name = Token.stringValue(); in parseSubRegisterIndexOperand()
1247 unsigned SubRegIndex = getSubRegIndex(Token.stringValue()); in parseSubRegisterIndexOperand()
1256 assert(Token.is(MIToken::exclaim)); in parseMDNode()
1257 auto Loc = Token.location(); in parseMDNode()
1259 if (Token.isNot(MIToken::IntegerLiteral) || Token.integerValue().isSigned()) in parseMDNode()
1281 if (Token.isNot(MIToken::IntegerLiteral)) in parseCFIOffset()
1283 if (Token.integerValue().getMinSignedBits() > 32) in parseCFIOffset()
1285 Offset = (int)Token.integerValue().getExtValue(); in parseCFIOffset()
1291 if (Token.isNot(MIToken::NamedRegister)) in parseCFIRegister()
1307 auto Kind = Token.kind(); in parseCFIOperand()
1357 switch (Token.kind()) { in parseIRBlock()
1360 F.getValueSymbolTable().lookup(Token.stringValue())); in parseIRBlock()
1362 return error(Twine("use of undefined IR block '") + Token.range() + "'"); in parseIRBlock()
1382 assert(Token.is(MIToken::kw_blockaddress)); in parseBlockAddressOperand()
1386 if (Token.isNot(MIToken::GlobalValue) && in parseBlockAddressOperand()
1387 Token.isNot(MIToken::NamedGlobalValue)) in parseBlockAddressOperand()
1399 if (Token.isNot(MIToken::IRBlock) && Token.isNot(MIToken::NamedIRBlock)) in parseBlockAddressOperand()
1413 assert(Token.is(MIToken::kw_target_index)); in parseTargetIndexOperand()
1417 if (Token.isNot(MIToken::Identifier)) in parseTargetIndexOperand()
1420 if (getTargetIndex(Token.stringValue(), Index)) in parseTargetIndexOperand()
1421 return error("use of undefined target index '" + Token.stringValue() + "'"); in parseTargetIndexOperand()
1432 assert(Token.is(MIToken::kw_liveout)); in parseLiveoutRegisterMaskOperand()
1440 if (Token.isNot(MIToken::NamedRegister)) in parseLiveoutRegisterMaskOperand()
1448 if (Token.isNot(MIToken::comma)) in parseLiveoutRegisterMaskOperand()
1460 switch (Token.kind()) { in parseMachineOperand()
1519 if (const auto *RegMask = getRegMask(Token.stringValue())) { in parseMachineOperand()
1536 if (Token.is(MIToken::kw_target_flags)) { in parseMachineOperandAndTargetFlags()
1541 if (Token.isNot(MIToken::Identifier)) in parseMachineOperandAndTargetFlags()
1543 if (getDirectTargetFlag(Token.stringValue(), TF)) { in parseMachineOperandAndTargetFlags()
1544 if (getBitmaskTargetFlag(Token.stringValue(), TF)) in parseMachineOperandAndTargetFlags()
1545 return error("use of undefined target flag '" + Token.stringValue() + in parseMachineOperandAndTargetFlags()
1549 while (Token.is(MIToken::comma)) { in parseMachineOperandAndTargetFlags()
1551 if (Token.isNot(MIToken::Identifier)) in parseMachineOperandAndTargetFlags()
1554 if (getBitmaskTargetFlag(Token.stringValue(), BitFlag)) in parseMachineOperandAndTargetFlags()
1555 return error("use of undefined target flag '" + Token.stringValue() + in parseMachineOperandAndTargetFlags()
1564 auto Loc = Token.location(); in parseMachineOperandAndTargetFlags()
1576 if (Token.isNot(MIToken::plus) && Token.isNot(MIToken::minus)) in parseOffset()
1578 StringRef Sign = Token.range(); in parseOffset()
1579 bool IsNegative = Token.is(MIToken::minus); in parseOffset()
1581 if (Token.isNot(MIToken::IntegerLiteral)) in parseOffset()
1583 if (Token.integerValue().getMinSignedBits() > 64) in parseOffset()
1585 Offset = Token.integerValue().getExtValue(); in parseOffset()
1593 assert(Token.is(MIToken::kw_align)); in parseAlignment()
1595 if (Token.isNot(MIToken::IntegerLiteral) || Token.integerValue().isSigned()) in parseAlignment()
1612 switch (Token.kind()) { in parseIRValue()
1614 V = MF.getFunction()->getValueSymbolTable().lookup(Token.stringValue()); in parseIRValue()
1634 if (parseIRConstant(Token.location(), Token.stringValue(), C)) in parseIRValue()
1643 return error(Twine("use of undefined IR value '") + Token.range() + "'"); in parseIRValue()
1648 assert(Token.hasIntegerValue()); in getUint64()
1649 if (Token.integerValue().getActiveBits() > 64) in getUint64()
1651 Result = Token.integerValue().getZExtValue(); in getUint64()
1657 switch (Token.kind()) { in parseMemoryOperandFlag()
1674 return error("duplicate '" + Token.stringValue() + "' memory operand flag"); in parseMemoryOperandFlag()
1680 switch (Token.kind()) { in parseMemoryPseudoSourceValue()
1711 switch (Token.kind()) { in parseMemoryPseudoSourceValue()
1722 MF.createExternalSymbolName(Token.stringValue())); in parseMemoryPseudoSourceValue()
1738 if (Token.is(MIToken::kw_constant_pool) || Token.is(MIToken::kw_stack) || in parseMachinePointerInfo()
1739 Token.is(MIToken::kw_got) || Token.is(MIToken::kw_jump_table) || in parseMachinePointerInfo()
1740 Token.is(MIToken::FixedStackObject) || Token.is(MIToken::StackObject) || in parseMachinePointerInfo()
1741 Token.is(MIToken::kw_call_entry)) { in parseMachinePointerInfo()
1751 if (Token.isNot(MIToken::NamedIRValue) && Token.isNot(MIToken::IRValue) && in parseMachinePointerInfo()
1752 Token.isNot(MIToken::GlobalValue) && in parseMachinePointerInfo()
1753 Token.isNot(MIToken::NamedGlobalValue) && in parseMachinePointerInfo()
1754 Token.isNot(MIToken::QuotedIRValue)) in parseMachinePointerInfo()
1773 while (Token.isMemoryOperandFlag()) { in parseMachineMemoryOperand()
1777 if (Token.isNot(MIToken::Identifier) || in parseMachineMemoryOperand()
1778 (Token.stringValue() != "load" && Token.stringValue() != "store")) in parseMachineMemoryOperand()
1780 if (Token.stringValue() == "load") in parseMachineMemoryOperand()
1786 if (Token.isNot(MIToken::IntegerLiteral)) in parseMachineMemoryOperand()
1794 if (Token.is(MIToken::Identifier)) { in parseMachineMemoryOperand()
1796 if (Token.stringValue() != Word) in parseMachineMemoryOperand()
1807 switch (Token.kind()) { in parseMachineMemoryOperand()