Lines Matching refs:MultiClass
40 MultiClass *MC;
49 errs() << "Multiclass:\n";
206 bool TGParser::AddSubMultiClass(MultiClass *CurMC,
208 MultiClass *SMC = SubMultiClass.MC;
218 // Add all of the defs in the subclass into the current multiclass.
220 // Clone the def and add it to the current multiclass
368 K == tgtok::MultiClass || K == tgtok::Foreach;
382 Init *TGParser::ParseObjectName(MultiClass *CurMultiClass) {
431 /// ParseMultiClassID - Parse and resolve a reference to a multiclass name.
436 MultiClass *TGParser::ParseMultiClassID() {
442 MultiClass *Result = MultiClasses[Lex.getCurStrVal()].get();
444 TokError("Couldn't find multiclass '" + Lex.getCurStrVal() + "'");
462 if (MultiClass *MC = ParseMultiClassID())
507 ParseSubMultiClassReference(MultiClass *CurMC) {
1226 // This needs to get resolved once the multiclass template arguments are
1229 // Otherwise, we're inside a multiclass, add it to the multiclass.
1232 // Copy the template arguments for the multiclass into the def.
1242 assert(MCNameRV && "multiclass record must have a NAME");
1686 /// CurRec will be non-null) and within the template args for a multiclass (in
1688 /// also happen within a def that is within a multiclass, which will set both
1822 /// template args for a def, which may or may not be in a multiclass. If null,
1823 /// these are the template args for a multiclass.
1979 /// ParseDef - Parse and return a top level or multiclass def, return the record
1984 bool TGParser::ParseDef(MultiClass *CurMultiClass) {
2019 // Otherwise, a def inside a multiclass, add it to the multiclass.
2023 "' already defined in this multiclass!");
2039 // Copy the template arguments for the multiclass into the def.
2060 bool TGParser::ParseForeach(MultiClass *CurMultiClass) {
2189 bool TGParser::ParseTopLevelLet(MultiClass *CurMultiClass) {
2228 /// ParseMultiClass - Parse a multiclass definition.
2230 /// MultiClassInst ::= MULTICLASS ID TemplateArgList?
2239 assert(Lex.getCode() == tgtok::MultiClass && "Unexpected token");
2240 Lex.Lex(); // Eat the multiclass token.
2243 return TokError("expected identifier after multiclass for name");
2248 llvm::make_unique<MultiClass>(Name, Lex.getLoc(),Records)));
2251 return TokError("multiclass '" + Name + "' already defined");
2288 return TokError("expected '{' in multiclass definition");
2290 return TokError("expected ';' in multiclass definition");
2294 return TokError("multiclass must contain at least one def");
2299 return TokError("expected 'let', 'def' or 'defm' in multiclass body");
2316 Record *TGParser::InstantiateMulticlassDef(MultiClass &MC, Record *DefProto,
2348 // Make a trail of SMLocs from the multiclass instantiations.
2359 // though, so that uses in nested multiclass names don't get
2412 // any multiclass expansions, add the record to the RecordKeeper. If we are
2413 // currently in a multiclass, it means this defm appears inside a
2414 // multiclass and its name won't be fully resolvable until we see
2438 bool TGParser::ResolveMulticlassDefArgs(MultiClass &MC, Record *CurRec,
2470 bool TGParser::ResolveMulticlassDef(MultiClass &MC,
2486 "' already defined in this multiclass!");
2489 // Copy the template arguments for the multiclass into the new def.
2499 /// ParseDefm - Parse the instantiation of a multiclass.
2503 bool TGParser::ParseDefm(MultiClass *CurMultiClass) {
2519 // This record also inherits from a regular class (non-multiclass)?
2531 // To instantiate a multiclass, we need to first get the multiclass, then
2532 // instantiate each def contained in the multiclass with the SubClassRef
2534 MultiClass *MC = MultiClasses[Ref.Rec->getName()].get();
2535 assert(MC && "Didn't lookup multiclass correctly?");
2542 "more template args specified than multiclass expects");
2544 // Loop over all the def's in the multiclass, instantiating each one.
2584 // A defm can inherit from regular classes (non-multiclass) as
2640 bool TGParser::ParseObject(MultiClass *MC) {
2643 return TokError("Expected class, def, defm, multiclass or let definition");
2649 case tgtok::MultiClass: return ParseMultiClass();
2655 bool TGParser::ParseObjectList(MultiClass *MC) {