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()
1112 if (Lex.Lex() != tgtok::less) { // Eat 'bits' in ParseType()
1116 if (Lex.Lex() != tgtok::IntVal) { // Eat '<' in ParseType()
1120 uint64_t Val = Lex.getCurIntVal(); in ParseType()
1121 if (Lex.Lex() != tgtok::greater) { // Eat count. in ParseType()
1125 Lex.Lex(); // Eat '>' in ParseType()
1129 if (Lex.Lex() != tgtok::less) { // Eat 'bits' in ParseType()
1133 Lex.Lex(); // Eat '<' in ParseType()
1180 switch (Lex.getCode()) { in ParseOperation()
1198 switch (Lex.getCode()) { in ParseOperation()
1201 Lex.Lex(); // eat the operation in ParseOperation()
1213 Lex.Lex(); // eat the operation in ParseOperation()
1218 Lex.Lex(); // eat the operation in ParseOperation()
1223 Lex.Lex(); // eat the operation in ParseOperation()
1228 Lex.Lex(); // eat the operation in ParseOperation()
1233 Lex.Lex(); // eat the operation in ParseOperation()
1238 Lex.Lex(); // eat the operation in ParseOperation()
1242 Lex.Lex(); // eat the operation in ParseOperation()
1246 Lex.Lex(); in ParseOperation()
1251 Lex.Lex(); // eat the operation in ParseOperation()
1256 Lex.Lex(); // eat the operation in ParseOperation()
1257 if (Lex.getCode() == tgtok::less) { in ParseOperation()
1350 Lex.Lex(); // eat the operation in ParseOperation()
1375 Lex.Lex(); // eat the operation in ParseOperation()
1386 SMLoc ExprLoc = Lex.getLoc(); in ParseOperation()
1444 tgtok::TokKind OpTok = Lex.getCode(); in ParseOperation()
1445 SMLoc OpLoc = Lex.getLoc(); in ParseOperation()
1446 Lex.Lex(); // eat the operation in ParseOperation()
1565 SMLoc InitLoc = Lex.getLoc(); in ParseOperation()
1759 SMLoc OpLoc = Lex.getLoc(); in ParseOperation()
1760 Lex.Lex(); // eat the operation in ParseOperation()
1775 SMLoc InitLoc = Lex.getLoc(); in ParseOperation()
1865 tgtok::TokKind LexCode = Lex.getCode(); in ParseOperation()
1866 Lex.Lex(); // eat the operation in ParseOperation()
1904 SMLoc MHSLoc = Lex.getLoc(); in ParseOperation()
1914 SMLoc RHSLoc = Lex.getLoc(); in ParseOperation()
2046 Lex.Lex(); // eat the operation in ParseOperation()
2086 if (Lex.getCode() != tgtok::comma) { in ParseOperation()
2091 if (Lex.Lex() != tgtok::Id) { // eat the ',' in ParseOperation()
2096 Init *A = StringInit::get(Records, Lex.getCurStrVal()); in ParseOperation()
2104 if (Lex.Lex() != tgtok::comma) { // eat the id in ParseOperation()
2109 if (Lex.Lex() != tgtok::Id) { // eat the ',' in ParseOperation()
2114 Init *B = StringInit::get(Records, Lex.getCurStrVal()); in ParseOperation()
2122 if (Lex.Lex() != tgtok::comma) { // eat the id in ParseOperation()
2126 Lex.Lex(); // eat the ',' in ParseOperation()
2185 if (Lex.getCode() == tgtok::Code) in ParseOperatorType()
2210 Lex.Lex(); // eat the operation in ParseOperationSubstr()
2226 SMLoc MHSLoc = Lex.getLoc(); in ParseOperationSubstr()
2231 SMLoc RHSLoc = Lex.getLoc(); in ParseOperationSubstr()
2234 RHSLoc = Lex.getLoc(); in ParseOperationSubstr()
2298 Lex.Lex(); // eat the operation in ParseOperationFind()
2314 SMLoc MHSLoc = Lex.getLoc(); in ParseOperationFind()
2319 SMLoc RHSLoc = Lex.getLoc(); in ParseOperationFind()
2322 RHSLoc = Lex.getLoc(); in ParseOperationFind()
2384 SMLoc OpLoc = Lex.getLoc(); in ParseOperationForEachFilter()
2385 tgtok::TokKind Operation = Lex.getCode(); in ParseOperationForEachFilter()
2386 Lex.Lex(); // eat the operation in ParseOperationForEachFilter()
2387 if (Lex.getCode() != tgtok::l_paren) { in ParseOperationForEachFilter()
2392 if (Lex.Lex() != tgtok::Id) { // eat the '(' in ParseOperationForEachFilter()
2397 Init *LHS = StringInit::get(Records, Lex.getCurStrVal()); in ParseOperationForEachFilter()
2398 Lex.Lex(); // eat the ID. in ParseOperationForEachFilter()
2508 Lex.Lex(); // eat the operation 'cond' in ParseOperationCond()
2615 tgtok::TokKind Code = Lex.getCode(); in ParseSimpleValue()
2626 Lex.Lex(); in ParseSimpleValue()
2630 Lex.Lex(); in ParseSimpleValue()
2633 R = IntInit::get(Records, Lex.getCurIntVal()); in ParseSimpleValue()
2634 Lex.Lex(); in ParseSimpleValue()
2637 auto BinaryVal = Lex.getCurBinaryIntVal(); in ParseSimpleValue()
2642 Lex.Lex(); in ParseSimpleValue()
2646 std::string Val = Lex.getCurStrVal(); in ParseSimpleValue()
2647 Lex.Lex(); in ParseSimpleValue()
2650 while (Lex.getCode() == tgtok::StrVal) { in ParseSimpleValue()
2651 Val += Lex.getCurStrVal(); in ParseSimpleValue()
2652 Lex.Lex(); in ParseSimpleValue()
2659 R = StringInit::get(Records, Lex.getCurStrVal(), StringInit::SF_Code); in ParseSimpleValue()
2660 Lex.Lex(); in ParseSimpleValue()
2664 Lex.Lex(); in ParseSimpleValue()
2667 SMRange NameLoc = Lex.getLocRange(); in ParseSimpleValue()
2668 StringInit *Name = StringInit::get(Records, Lex.getCurStrVal()); in ParseSimpleValue()
2669 tgtok::TokKind Next = Lex.Lex(); in ParseSimpleValue()
2686 Lex.Lex(); // consume the < in ParseSimpleValue()
2701 SMLoc BraceLoc = Lex.getLoc(); in ParseSimpleValue()
2702 Lex.Lex(); // eat the '{' in ParseSimpleValue()
2705 if (Lex.getCode() != tgtok::r_brace) { in ParseSimpleValue()
2751 Lex.Lex(); // eat the '[' in ParseSimpleValue()
2767 if (Lex.getCode() != tgtok::r_square) { in ParseSimpleValue()
2842 Lex.Lex(); // eat the '(' in ParseSimpleValue()
2843 if (Lex.getCode() != tgtok::Id && Lex.getCode() != tgtok::XCast && in ParseSimpleValue()
2844 Lex.getCode() != tgtok::question && Lex.getCode() != tgtok::XGetDagOp) { in ParseSimpleValue()
2855 if (Lex.getCode() != tgtok::VarName) { // eat the ':' in ParseSimpleValue()
2859 OperatorName = StringInit::get(Records, Lex.getCurStrVal()); in ParseSimpleValue()
2860 Lex.Lex(); // eat the VarName. in ParseSimpleValue()
2864 if (Lex.getCode() != tgtok::r_paren) { in ParseSimpleValue()
2889 SMLoc LHSLoc = Lex.getLoc(); in ParseValue()
2895 switch (Lex.getCode()) { in ParseValue()
2902 SMLoc CurlyLoc = Lex.getLoc(); in ParseValue()
2903 Lex.Lex(); // eat the '{' in ParseValue()
2937 Lex.Lex(); // eat the '[' in ParseValue()
2961 if (Lex.Lex() != tgtok::Id) { // eat the . in ParseValue()
2965 SMRange FieldNameLoc = Lex.getLocRange(); in ParseValue()
2966 StringInit *FieldName = StringInit::get(Records, Lex.getCurStrVal()); in ParseValue()
2968 TokError("Cannot access field '" + Lex.getCurStrVal() + "' of value '" + in ParseValue()
2987 Lex.Lex(); // eat field name in ParseValue()
2992 SMLoc PasteLoc = Lex.getLoc(); in ParseValue()
3001 Lex.Lex(); // Eat the '#'. in ParseValue()
3005 switch (Lex.getCode()) { in ParseValue()
3037 Lex.Lex(); // Eat the '#'. in ParseValue()
3038 switch (Lex.getCode()) { in ParseValue()
3093 if (Lex.getCode() == tgtok::VarName) { in ParseDagArgList()
3095 StringInit *VarName = StringInit::get(Records, Lex.getCurStrVal()); in ParseDagArgList()
3097 Lex.Lex(); in ParseDagArgList()
3108 if (Lex.getCode() == tgtok::colon) { in ParseDagArgList()
3109 if (Lex.Lex() != tgtok::VarName) { // eat the ':' in ParseDagArgList()
3114 VarName = StringInit::get(Records, Lex.getCurStrVal()); in ParseDagArgList()
3115 Lex.Lex(); // eat the VarName. in ParseDagArgList()
3142 if (Lex.getCode() == tgtok::r_square) in ParseValueList()
3176 SMLoc ValueLoc = Lex.getLoc(); in ParseTemplateArgValueList()
3186 if (Lex.getCode() == tgtok::equal) { in ParseTemplateArgValueList()
3198 Lex.Lex(); // eat the '='. in ParseTemplateArgValueList()
3199 ValueLoc = Lex.getLoc(); in ParseTemplateArgValueList()
3245 if (Lex.getCode() != tgtok::Id) { in ParseDeclaration()
3250 std::string Str = Lex.getCurStrVal(); in ParseDeclaration()
3261 SMLoc IdLoc = Lex.getLoc(); in ParseDeclaration()
3263 Lex.Lex(); in ParseDeclaration()
3288 SMLoc ValLoc = Lex.getLoc(); in ParseDeclaration()
3312 if (Lex.getCode() != tgtok::Id) { in ParseForeachDeclaration()
3317 Init *DeclName = StringInit::get(Records, Lex.getCurStrVal()); in ParseForeachDeclaration()
3318 Lex.Lex(); in ParseForeachDeclaration()
3329 switch (Lex.getCode()) { in ParseForeachDeclaration()
3331 Lex.Lex(); // eat the '{' in ParseForeachDeclaration()
3341 SMLoc ValueLoc = Lex.getLoc(); in ParseForeachDeclaration()
3392 assert(Lex.getCode() == tgtok::less && "Not a template arg list!"); in ParseTemplateArgList()
3393 Lex.Lex(); // eat the '<' in ParseTemplateArgList()
3406 SMLoc Loc = Lex.getLoc(); in ParseTemplateArgList()
3432 if (Lex.getCode() == tgtok::Assert) in ParseBodyItem()
3435 if (Lex.getCode() == tgtok::Defvar) in ParseBodyItem()
3438 if (Lex.getCode() == tgtok::Dump) in ParseBodyItem()
3441 if (Lex.getCode() != tgtok::Let) { in ParseBodyItem()
3451 if (Lex.Lex() != tgtok::Id) in ParseBodyItem()
3454 SMLoc IdLoc = Lex.getLoc(); in ParseBodyItem()
3455 StringInit *FieldName = StringInit::get(Records, Lex.getCurStrVal()); in ParseBodyItem()
3456 Lex.Lex(); // eat the field name. in ParseBodyItem()
3501 while (Lex.getCode() != tgtok::r_brace) in ParseBody()
3506 Lex.Lex(); in ParseBody()
3509 SMLoc SemiLoc = Lex.getLoc(); in ParseBody()
3594 SMLoc DefLoc = Lex.getLoc(); in ParseDef()
3595 assert(Lex.getCode() == tgtok::Def && "Unknown tok"); in ParseDef()
3596 Lex.Lex(); // Eat the 'def' token. in ParseDef()
3601 SMLoc NameLoc = Lex.getCode() == tgtok::Id ? Lex.getLoc() : DefLoc; in ParseDef()
3627 assert(Lex.getCode() == tgtok::Defset); in ParseDefset()
3628 Lex.Lex(); // Eat the 'defset' token in ParseDefset()
3631 Defset.Loc = Lex.getLoc(); in ParseDefset()
3639 if (Lex.getCode() != tgtok::Id) in ParseDefset()
3641 StringInit *DeclName = StringInit::get(Records, Lex.getCurStrVal()); in ParseDefset()
3645 if (Lex.Lex() != tgtok::equal) // Eat the identifier in ParseDefset()
3647 if (Lex.Lex() != tgtok::l_brace) // Eat the '=' in ParseDefset()
3649 SMLoc BraceLoc = Lex.getLoc(); in ParseDefset()
3650 Lex.Lex(); // Eat the '{' in ParseDefset()
3673 assert(Lex.getCode() == tgtok::Defvar); in ParseDefvar()
3674 Lex.Lex(); // Eat the 'defvar' token in ParseDefvar()
3676 if (Lex.getCode() != tgtok::Id) in ParseDefvar()
3678 StringInit *DeclName = StringInit::get(Records, Lex.getCurStrVal()); in ParseDefvar()
3694 Lex.Lex(); in ParseDefvar()
3720 SMLoc Loc = Lex.getLoc(); in ParseForeach()
3721 assert(Lex.getCode() == tgtok::Foreach && "Unknown tok"); in ParseForeach()
3722 Lex.Lex(); // Eat the 'for' token. in ParseForeach()
3740 if (Lex.getCode() != tgtok::l_brace) { in ParseForeach()
3745 SMLoc BraceLoc = Lex.getLoc(); in ParseForeach()
3747 Lex.Lex(); // eat the '{'. in ParseForeach()
3774 SMLoc Loc = Lex.getLoc(); in ParseIf()
3775 assert(Lex.getCode() == tgtok::If && "Unknown tok"); in ParseIf()
3776 Lex.Lex(); // Eat the 'if' token. in ParseIf()
3851 if (Lex.getCode() != tgtok::l_brace) { in ParseIfBody()
3856 SMLoc BraceLoc = Lex.getLoc(); in ParseIfBody()
3858 Lex.Lex(); // eat the '{'. in ParseIfBody()
3878 assert(Lex.getCode() == tgtok::Assert && "Unknown tok"); in ParseAssert()
3879 Lex.Lex(); // Eat the 'assert' token. in ParseAssert()
3881 SMLoc ConditionLoc = Lex.getLoc(); in ParseAssert()
3911 assert(Lex.getCode() == tgtok::Class && "Unexpected token!"); in ParseClass()
3912 Lex.Lex(); in ParseClass()
3914 if (Lex.getCode() != tgtok::Id) in ParseClass()
3917 Record *CurRec = Records.getClass(Lex.getCurStrVal()); in ParseClass()
3926 CurRec->updateClassLoc(Lex.getLoc()); in ParseClass()
3929 auto NewRec = std::make_unique<Record>(Lex.getCurStrVal(), Lex.getLoc(), in ParseClass()
3934 Lex.Lex(); // eat the name. in ParseClass()
3939 if (Lex.getCode() == tgtok::less) in ParseClass()
3961 if (Lex.getCode() != tgtok::Id) { in ParseLetList()
3967 StringInit *Name = StringInit::get(Records, Lex.getCurStrVal()); in ParseLetList()
3968 SMLoc NameLoc = Lex.getLoc(); in ParseLetList()
3969 Lex.Lex(); // Eat the identifier. in ParseLetList()
4003 assert(Lex.getCode() == tgtok::Let && "Unexpected token"); in ParseTopLevelLet()
4004 Lex.Lex(); in ParseTopLevelLet()
4016 if (Lex.getCode() != tgtok::l_brace) { in ParseTopLevelLet()
4021 SMLoc BraceLoc = Lex.getLoc(); in ParseTopLevelLet()
4023 Lex.Lex(); // eat the '{'. in ParseTopLevelLet()
4059 assert(Lex.getCode() == tgtok::MultiClass && "Unexpected token"); in ParseMultiClass()
4060 Lex.Lex(); // Eat the multiclass token. in ParseMultiClass()
4062 if (Lex.getCode() != tgtok::Id) in ParseMultiClass()
4064 std::string Name = Lex.getCurStrVal(); in ParseMultiClass()
4068 std::make_unique<MultiClass>(Name, Lex.getLoc(),Records))); in ParseMultiClass()
4074 Lex.Lex(); // Eat the identifier. in ParseMultiClass()
4080 if (Lex.getCode() == tgtok::less) in ParseMultiClass()
4107 if (Lex.getCode() != tgtok::l_brace) { in ParseMultiClass()
4113 if (Lex.Lex() == tgtok::r_brace) // eat the '{'. in ParseMultiClass()
4116 while (Lex.getCode() != tgtok::r_brace) { in ParseMultiClass()
4117 switch (Lex.getCode()) { in ParseMultiClass()
4135 Lex.Lex(); // eat the '}'. in ParseMultiClass()
4138 SMLoc SemiLoc = Lex.getLoc(); in ParseMultiClass()
4158 assert(Lex.getCode() == tgtok::Defm && "Unexpected token!"); in ParseDefm()
4159 Lex.Lex(); // eat the defm in ParseDefm()
4173 if (Lex.getCode() != tgtok::colon) in ParseDefm()
4183 Lex.Lex(); in ParseDefm()
4185 SMLoc SubClassLoc = Lex.getLoc(); in ParseDefm()
4210 if (Lex.getCode() != tgtok::Id) in ParseDefm()
4213 SubClassLoc = Lex.getLoc(); in ParseDefm()
4217 InheritFromClass = (Records.getClass(Lex.getCurStrVal()) != nullptr); in ParseDefm()
4272 switch (Lex.getCode()) { in ParseObject()
4305 while (tgtok::isObjectStart(Lex.getCode())) { in ParseObjectList()
4313 Lex.Lex(); // Prime the lexer. in ParseFile()
4320 if (Lex.getCode() == tgtok::Eof) in ParseFile()
4395 SMLoc Loc = Lex.getLoc(); in ParseDump()
4396 assert(Lex.getCode() == tgtok::Dump && "Unknown tok"); in ParseDump()
4397 Lex.Lex(); // eat the operation in ParseDump()