Lines Matching refs:Lex

657   if (Lex.getCode() == K) {  in consume()
658 Lex.Lex(); in consume()
671 switch (Lex.getCode()) { in ParseObjectName()
709 if (Lex.getCode() != tgtok::Id) { in ParseClassID()
714 Record *Result = Records.getClass(Lex.getCurStrVal()); in ParseClassID()
716 std::string Msg("Couldn't find class '" + Lex.getCurStrVal() + "'"); in ParseClassID()
717 if (MultiClasses[Lex.getCurStrVal()].get()) in ParseClassID()
719 Lex.getCurStrVal() + "'"); in ParseClassID()
723 Result->appendReferenceLoc(Lex.getLocRange()); in ParseClassID()
726 Lex.Lex(); in ParseClassID()
736 if (Lex.getCode() != tgtok::Id) { in ParseMultiClassID()
741 MultiClass *Result = MultiClasses[Lex.getCurStrVal()].get(); in ParseMultiClassID()
743 TokError("Couldn't find multiclass '" + Lex.getCurStrVal() + "'"); in ParseMultiClassID()
745 Lex.Lex(); in ParseMultiClassID()
758 Result.RefRange.Start = Lex.getLoc(); in ParseSubClassReference()
770 Result.RefRange.End = Lex.getLoc(); in ParseSubClassReference()
785 Result.RefRange.End = Lex.getLoc(); in ParseSubClassReference()
799 Result.RefRange.Start = Lex.getLoc(); in ParseSubMultiClassReference()
806 Result.RefRange.End = Lex.getLoc(); in ParseSubMultiClassReference()
816 Result.RefRange.End = Lex.getLoc(); in ParseSubMultiClassReference()
832 auto LHSLoc = Lex.getLoc(); in ParseSliceElement()
839 switch (Lex.getCode()) { in ParseSliceElement()
842 Lex.Lex(); // eat in ParseSliceElement()
843 auto RHSLoc = Lex.getLoc(); in ParseSliceElement()
856 auto i = -Lex.getCurIntVal(); in ParseSliceElement()
862 Lex.Lex(); // eat IntVal in ParseSliceElement()
908 auto LHSLoc = Lex.getLoc(); in ParseSliceElements()
931 if (Lex.getCode() != tgtok::comma) in ParseSliceElements()
934 Lex.Lex(); // eat comma in ParseSliceElements()
941 } while (Lex.getCode() != tgtok::r_square); in ParseSliceElements()
985 switch (Lex.getCode()) { in ParseRangePiece()
992 Lex.Lex(); // eat in ParseRangePiece()
1005 End = -Lex.getCurIntVal(); in ParseRangePiece()
1006 Lex.Lex(); in ParseRangePiece()
1045 SMLoc StartLoc = Lex.getLoc(); in ParseOptionalRangeList()
1064 SMLoc StartLoc = Lex.getLoc(); in ParseOptionalBitList()
1091 switch (Lex.getCode()) { in ParseType()
1095 Lex.Lex(); in ParseType()
1098 Lex.Lex(); in ParseType()
1101 Lex.Lex(); in ParseType()
1104 Lex.Lex(); in ParseType()
1107 auto I = TypeAliases.find(Lex.getCurStrVal()); in ParseType()
1109 Lex.Lex(); in ParseType()
1118 if (Lex.Lex() != tgtok::less) { // Eat 'bits' in ParseType()
1122 if (Lex.Lex() != tgtok::IntVal) { // Eat '<' in ParseType()
1126 uint64_t Val = Lex.getCurIntVal(); in ParseType()
1127 if (Lex.Lex() != tgtok::greater) { // Eat count. in ParseType()
1131 Lex.Lex(); // Eat '>' in ParseType()
1135 if (Lex.Lex() != tgtok::less) { // Eat 'bits' in ParseType()
1139 Lex.Lex(); // Eat '<' in ParseType()
1186 switch (Lex.getCode()) { in ParseOperation()
1204 switch (Lex.getCode()) { in ParseOperation()
1207 Lex.Lex(); // eat the operation in ParseOperation()
1219 Lex.Lex(); // eat the operation in ParseOperation()
1224 Lex.Lex(); // eat the operation in ParseOperation()
1229 Lex.Lex(); // eat the operation in ParseOperation()
1234 Lex.Lex(); // eat the operation in ParseOperation()
1239 Lex.Lex(); // eat the operation in ParseOperation()
1244 Lex.Lex(); // eat the operation in ParseOperation()
1248 Lex.Lex(); // eat the operation in ParseOperation()
1252 Lex.Lex(); in ParseOperation()
1257 Lex.Lex(); // eat the operation in ParseOperation()
1262 Lex.Lex(); // eat the operation in ParseOperation()
1263 if (Lex.getCode() == tgtok::less) { in ParseOperation()
1356 Lex.Lex(); // eat the operation in ParseOperation()
1381 Lex.Lex(); // eat the operation in ParseOperation()
1392 SMLoc ExprLoc = Lex.getLoc(); in ParseOperation()
1450 tgtok::TokKind OpTok = Lex.getCode(); in ParseOperation()
1451 SMLoc OpLoc = Lex.getLoc(); in ParseOperation()
1452 Lex.Lex(); // eat the operation in ParseOperation()
1571 SMLoc InitLoc = Lex.getLoc(); in ParseOperation()
1765 SMLoc OpLoc = Lex.getLoc(); in ParseOperation()
1766 Lex.Lex(); // eat the operation in ParseOperation()
1781 SMLoc InitLoc = Lex.getLoc(); in ParseOperation()
1871 tgtok::TokKind LexCode = Lex.getCode(); in ParseOperation()
1872 Lex.Lex(); // eat the operation in ParseOperation()
1910 SMLoc MHSLoc = Lex.getLoc(); in ParseOperation()
1920 SMLoc RHSLoc = Lex.getLoc(); in ParseOperation()
2052 Lex.Lex(); // eat the operation in ParseOperation()
2092 if (Lex.getCode() != tgtok::comma) { in ParseOperation()
2097 if (Lex.Lex() != tgtok::Id) { // eat the ',' in ParseOperation()
2102 Init *A = StringInit::get(Records, Lex.getCurStrVal()); in ParseOperation()
2110 if (Lex.Lex() != tgtok::comma) { // eat the id in ParseOperation()
2115 if (Lex.Lex() != tgtok::Id) { // eat the ',' in ParseOperation()
2120 Init *B = StringInit::get(Records, Lex.getCurStrVal()); in ParseOperation()
2128 if (Lex.Lex() != tgtok::comma) { // eat the id in ParseOperation()
2132 Lex.Lex(); // eat the ',' in ParseOperation()
2191 if (Lex.getCode() == tgtok::Code) in ParseOperatorType()
2216 Lex.Lex(); // eat the operation in ParseOperationSubstr()
2232 SMLoc MHSLoc = Lex.getLoc(); in ParseOperationSubstr()
2237 SMLoc RHSLoc = Lex.getLoc(); in ParseOperationSubstr()
2240 RHSLoc = Lex.getLoc(); in ParseOperationSubstr()
2304 Lex.Lex(); // eat the operation in ParseOperationFind()
2320 SMLoc MHSLoc = Lex.getLoc(); in ParseOperationFind()
2325 SMLoc RHSLoc = Lex.getLoc(); in ParseOperationFind()
2328 RHSLoc = Lex.getLoc(); in ParseOperationFind()
2390 SMLoc OpLoc = Lex.getLoc(); in ParseOperationForEachFilter()
2391 tgtok::TokKind Operation = Lex.getCode(); in ParseOperationForEachFilter()
2392 Lex.Lex(); // eat the operation in ParseOperationForEachFilter()
2393 if (Lex.getCode() != tgtok::l_paren) { in ParseOperationForEachFilter()
2398 if (Lex.Lex() != tgtok::Id) { // eat the '(' in ParseOperationForEachFilter()
2403 Init *LHS = StringInit::get(Records, Lex.getCurStrVal()); in ParseOperationForEachFilter()
2404 Lex.Lex(); // eat the ID. in ParseOperationForEachFilter()
2514 Lex.Lex(); // eat the operation 'cond' in ParseOperationCond()
2621 tgtok::TokKind Code = Lex.getCode(); in ParseSimpleValue()
2632 Lex.Lex(); in ParseSimpleValue()
2636 Lex.Lex(); in ParseSimpleValue()
2639 R = IntInit::get(Records, Lex.getCurIntVal()); in ParseSimpleValue()
2640 Lex.Lex(); in ParseSimpleValue()
2643 auto BinaryVal = Lex.getCurBinaryIntVal(); in ParseSimpleValue()
2648 Lex.Lex(); in ParseSimpleValue()
2652 std::string Val = Lex.getCurStrVal(); in ParseSimpleValue()
2653 Lex.Lex(); in ParseSimpleValue()
2656 while (Lex.getCode() == tgtok::StrVal) { in ParseSimpleValue()
2657 Val += Lex.getCurStrVal(); in ParseSimpleValue()
2658 Lex.Lex(); in ParseSimpleValue()
2665 R = StringInit::get(Records, Lex.getCurStrVal(), StringInit::SF_Code); in ParseSimpleValue()
2666 Lex.Lex(); in ParseSimpleValue()
2670 Lex.Lex(); in ParseSimpleValue()
2673 SMRange NameLoc = Lex.getLocRange(); in ParseSimpleValue()
2674 StringInit *Name = StringInit::get(Records, Lex.getCurStrVal()); in ParseSimpleValue()
2675 tgtok::TokKind Next = Lex.Lex(); in ParseSimpleValue()
2692 Lex.Lex(); // consume the < in ParseSimpleValue()
2707 SMLoc BraceLoc = Lex.getLoc(); in ParseSimpleValue()
2708 Lex.Lex(); // eat the '{' in ParseSimpleValue()
2711 if (Lex.getCode() != tgtok::r_brace) { in ParseSimpleValue()
2757 Lex.Lex(); // eat the '[' in ParseSimpleValue()
2773 if (Lex.getCode() != tgtok::r_square) { in ParseSimpleValue()
2848 Lex.Lex(); // eat the '(' in ParseSimpleValue()
2849 if (Lex.getCode() != tgtok::Id && Lex.getCode() != tgtok::XCast && in ParseSimpleValue()
2850 Lex.getCode() != tgtok::question && Lex.getCode() != tgtok::XGetDagOp) { in ParseSimpleValue()
2861 if (Lex.getCode() != tgtok::VarName) { // eat the ':' in ParseSimpleValue()
2865 OperatorName = StringInit::get(Records, Lex.getCurStrVal()); in ParseSimpleValue()
2866 Lex.Lex(); // eat the VarName. in ParseSimpleValue()
2870 if (Lex.getCode() != tgtok::r_paren) { in ParseSimpleValue()
2895 SMLoc LHSLoc = Lex.getLoc(); in ParseValue()
2901 switch (Lex.getCode()) { in ParseValue()
2908 SMLoc CurlyLoc = Lex.getLoc(); in ParseValue()
2909 Lex.Lex(); // eat the '{' in ParseValue()
2943 Lex.Lex(); // eat the '[' in ParseValue()
2967 if (Lex.Lex() != tgtok::Id) { // eat the . in ParseValue()
2971 SMRange FieldNameLoc = Lex.getLocRange(); in ParseValue()
2972 StringInit *FieldName = StringInit::get(Records, Lex.getCurStrVal()); in ParseValue()
2974 TokError("Cannot access field '" + Lex.getCurStrVal() + "' of value '" + in ParseValue()
2993 Lex.Lex(); // eat field name in ParseValue()
2998 SMLoc PasteLoc = Lex.getLoc(); in ParseValue()
3007 Lex.Lex(); // Eat the '#'. in ParseValue()
3011 switch (Lex.getCode()) { in ParseValue()
3043 Lex.Lex(); // Eat the '#'. in ParseValue()
3044 switch (Lex.getCode()) { in ParseValue()
3099 if (Lex.getCode() == tgtok::VarName) { in ParseDagArgList()
3101 StringInit *VarName = StringInit::get(Records, Lex.getCurStrVal()); in ParseDagArgList()
3103 Lex.Lex(); in ParseDagArgList()
3114 if (Lex.getCode() == tgtok::colon) { in ParseDagArgList()
3115 if (Lex.Lex() != tgtok::VarName) { // eat the ':' in ParseDagArgList()
3120 VarName = StringInit::get(Records, Lex.getCurStrVal()); in ParseDagArgList()
3121 Lex.Lex(); // eat the VarName. in ParseDagArgList()
3148 if (Lex.getCode() == tgtok::r_square) in ParseValueList()
3182 SMLoc ValueLoc = Lex.getLoc(); in ParseTemplateArgValueList()
3192 if (Lex.getCode() == tgtok::equal) { in ParseTemplateArgValueList()
3204 Lex.Lex(); // eat the '='. in ParseTemplateArgValueList()
3205 ValueLoc = Lex.getLoc(); in ParseTemplateArgValueList()
3251 if (Lex.getCode() != tgtok::Id) { in ParseDeclaration()
3256 std::string Str = Lex.getCurStrVal(); in ParseDeclaration()
3267 SMLoc IdLoc = Lex.getLoc(); in ParseDeclaration()
3269 Lex.Lex(); in ParseDeclaration()
3294 SMLoc ValLoc = Lex.getLoc(); in ParseDeclaration()
3318 if (Lex.getCode() != tgtok::Id) { in ParseForeachDeclaration()
3323 Init *DeclName = StringInit::get(Records, Lex.getCurStrVal()); in ParseForeachDeclaration()
3324 Lex.Lex(); in ParseForeachDeclaration()
3335 switch (Lex.getCode()) { in ParseForeachDeclaration()
3337 Lex.Lex(); // eat the '{' in ParseForeachDeclaration()
3347 SMLoc ValueLoc = Lex.getLoc(); in ParseForeachDeclaration()
3398 assert(Lex.getCode() == tgtok::less && "Not a template arg list!"); in ParseTemplateArgList()
3399 Lex.Lex(); // eat the '<' in ParseTemplateArgList()
3412 SMLoc Loc = Lex.getLoc(); in ParseTemplateArgList()
3438 if (Lex.getCode() == tgtok::Assert) in ParseBodyItem()
3441 if (Lex.getCode() == tgtok::Defvar) in ParseBodyItem()
3444 if (Lex.getCode() == tgtok::Dump) in ParseBodyItem()
3447 if (Lex.getCode() != tgtok::Let) { in ParseBodyItem()
3457 if (Lex.Lex() != tgtok::Id) in ParseBodyItem()
3460 SMLoc IdLoc = Lex.getLoc(); in ParseBodyItem()
3461 StringInit *FieldName = StringInit::get(Records, Lex.getCurStrVal()); in ParseBodyItem()
3462 Lex.Lex(); // eat the field name. in ParseBodyItem()
3507 while (Lex.getCode() != tgtok::r_brace) in ParseBody()
3512 Lex.Lex(); in ParseBody()
3515 SMLoc SemiLoc = Lex.getLoc(); in ParseBody()
3600 SMLoc DefLoc = Lex.getLoc(); in ParseDef()
3601 assert(Lex.getCode() == tgtok::Def && "Unknown tok"); in ParseDef()
3602 Lex.Lex(); // Eat the 'def' token. in ParseDef()
3607 SMLoc NameLoc = Lex.getCode() == tgtok::Id ? Lex.getLoc() : DefLoc; in ParseDef()
3633 assert(Lex.getCode() == tgtok::Defset); in ParseDefset()
3634 Lex.Lex(); // Eat the 'defset' token in ParseDefset()
3637 Defset.Loc = Lex.getLoc(); in ParseDefset()
3645 if (Lex.getCode() != tgtok::Id) in ParseDefset()
3647 StringInit *DeclName = StringInit::get(Records, Lex.getCurStrVal()); in ParseDefset()
3651 if (Lex.Lex() != tgtok::equal) // Eat the identifier in ParseDefset()
3653 if (Lex.Lex() != tgtok::l_brace) // Eat the '=' in ParseDefset()
3655 SMLoc BraceLoc = Lex.getLoc(); in ParseDefset()
3656 Lex.Lex(); // Eat the '{' in ParseDefset()
3679 assert(Lex.getCode() == tgtok::Deftype); in ParseDeftype()
3680 Lex.Lex(); // Eat the 'deftype' token in ParseDeftype()
3682 if (Lex.getCode() != tgtok::Id) in ParseDeftype()
3685 const std::string TypeName = Lex.getCurStrVal(); in ParseDeftype()
3689 Lex.Lex(); in ParseDeftype()
3693 SMLoc Loc = Lex.getLoc(); in ParseDeftype()
3715 assert(Lex.getCode() == tgtok::Defvar); in ParseDefvar()
3716 Lex.Lex(); // Eat the 'defvar' token in ParseDefvar()
3718 if (Lex.getCode() != tgtok::Id) in ParseDefvar()
3720 StringInit *DeclName = StringInit::get(Records, Lex.getCurStrVal()); in ParseDefvar()
3736 Lex.Lex(); in ParseDefvar()
3762 SMLoc Loc = Lex.getLoc(); in ParseForeach()
3763 assert(Lex.getCode() == tgtok::Foreach && "Unknown tok"); in ParseForeach()
3764 Lex.Lex(); // Eat the 'for' token. in ParseForeach()
3782 if (Lex.getCode() != tgtok::l_brace) { in ParseForeach()
3787 SMLoc BraceLoc = Lex.getLoc(); in ParseForeach()
3789 Lex.Lex(); // eat the '{'. in ParseForeach()
3816 SMLoc Loc = Lex.getLoc(); in ParseIf()
3817 assert(Lex.getCode() == tgtok::If && "Unknown tok"); in ParseIf()
3818 Lex.Lex(); // Eat the 'if' token. in ParseIf()
3893 if (Lex.getCode() != tgtok::l_brace) { in ParseIfBody()
3898 SMLoc BraceLoc = Lex.getLoc(); in ParseIfBody()
3900 Lex.Lex(); // eat the '{'. in ParseIfBody()
3920 assert(Lex.getCode() == tgtok::Assert && "Unknown tok"); in ParseAssert()
3921 Lex.Lex(); // Eat the 'assert' token. in ParseAssert()
3923 SMLoc ConditionLoc = Lex.getLoc(); in ParseAssert()
3953 assert(Lex.getCode() == tgtok::Class && "Unexpected token!"); in ParseClass()
3954 Lex.Lex(); in ParseClass()
3956 if (Lex.getCode() != tgtok::Id) in ParseClass()
3959 const std::string &Name = Lex.getCurStrVal(); in ParseClass()
3969 CurRec->updateClassLoc(Lex.getLoc()); in ParseClass()
3972 auto NewRec = std::make_unique<Record>(Lex.getCurStrVal(), Lex.getLoc(), in ParseClass()
3981 Lex.Lex(); // eat the name. in ParseClass()
3986 if (Lex.getCode() == tgtok::less) in ParseClass()
4008 if (Lex.getCode() != tgtok::Id) { in ParseLetList()
4014 StringInit *Name = StringInit::get(Records, Lex.getCurStrVal()); in ParseLetList()
4015 SMLoc NameLoc = Lex.getLoc(); in ParseLetList()
4016 Lex.Lex(); // Eat the identifier. in ParseLetList()
4050 assert(Lex.getCode() == tgtok::Let && "Unexpected token"); in ParseTopLevelLet()
4051 Lex.Lex(); in ParseTopLevelLet()
4063 if (Lex.getCode() != tgtok::l_brace) { in ParseTopLevelLet()
4068 SMLoc BraceLoc = Lex.getLoc(); in ParseTopLevelLet()
4070 Lex.Lex(); // eat the '{'. in ParseTopLevelLet()
4106 assert(Lex.getCode() == tgtok::MultiClass && "Unexpected token"); in ParseMultiClass()
4107 Lex.Lex(); // Eat the multiclass token. in ParseMultiClass()
4109 if (Lex.getCode() != tgtok::Id) in ParseMultiClass()
4111 std::string Name = Lex.getCurStrVal(); in ParseMultiClass()
4115 std::make_unique<MultiClass>(Name, Lex.getLoc(),Records))); in ParseMultiClass()
4121 Lex.Lex(); // Eat the identifier. in ParseMultiClass()
4127 if (Lex.getCode() == tgtok::less) in ParseMultiClass()
4154 if (Lex.getCode() != tgtok::l_brace) { in ParseMultiClass()
4160 if (Lex.Lex() == tgtok::r_brace) // eat the '{'. in ParseMultiClass()
4163 while (Lex.getCode() != tgtok::r_brace) { in ParseMultiClass()
4164 switch (Lex.getCode()) { in ParseMultiClass()
4182 Lex.Lex(); // eat the '}'. in ParseMultiClass()
4185 SMLoc SemiLoc = Lex.getLoc(); in ParseMultiClass()
4205 assert(Lex.getCode() == tgtok::Defm && "Unexpected token!"); in ParseDefm()
4206 Lex.Lex(); // eat the defm in ParseDefm()
4220 if (Lex.getCode() != tgtok::colon) in ParseDefm()
4230 Lex.Lex(); in ParseDefm()
4232 SMLoc SubClassLoc = Lex.getLoc(); in ParseDefm()
4257 if (Lex.getCode() != tgtok::Id) in ParseDefm()
4260 SubClassLoc = Lex.getLoc(); in ParseDefm()
4264 InheritFromClass = (Records.getClass(Lex.getCurStrVal()) != nullptr); in ParseDefm()
4320 switch (Lex.getCode()) { in ParseObject()
4355 while (tgtok::isObjectStart(Lex.getCode())) { in ParseObjectList()
4363 Lex.Lex(); // Prime the lexer. in ParseFile()
4370 if (Lex.getCode() == tgtok::Eof) in ParseFile()
4444 SMLoc Loc = Lex.getLoc(); in ParseDump()
4445 assert(Lex.getCode() == tgtok::Dump && "Unknown tok"); in ParseDump()
4446 Lex.Lex(); // eat the operation in ParseDump()