Lines Matching refs:MultiClass
39 MultiClass *MC;
48 errs() << "Multiclass:\n";
207 bool TGParser::AddSubMultiClass(MultiClass *CurMC,
209 MultiClass *SMC = SubMultiClass.MC;
222 // Add all of the defs in the subclass into the current multiclass.
223 for (MultiClass::RecordVector::const_iterator i = SMC->DefPrototypes.begin(),
227 // Clone the def and add it to the current multiclass
265 for (MultiClass::RecordVector::iterator j =
380 K == tgtok::MultiClass || K == tgtok::Foreach;
394 Init *TGParser::ParseObjectName(MultiClass *CurMultiClass) {
443 /// ParseMultiClassID - Parse and resolve a reference to a multiclass name.
448 MultiClass *TGParser::ParseMultiClassID() {
454 MultiClass *Result = MultiClasses[Lex.getCurStrVal()];
456 TokError("Couldn't find multiclass '" + Lex.getCurStrVal() + "'");
474 if (MultiClass *MC = ParseMultiClassID())
519 ParseSubMultiClassReference(MultiClass *CurMC) {
728 /// IDValue ::= ID [multiclass local value]
729 /// IDValue ::= ID [multiclass template argument]
1635 /// CurRec will be non-null) and within the template args for a multiclass (in
1637 /// also happen within a def that is within a multiclass, which will set both
1769 /// template args for a def, which may or may not be in a multiclass. If null,
1770 /// these are the template args for a multiclass.
1927 /// ParseDef - Parse and return a top level or multiclass def, return the record
1932 bool TGParser::ParseDef(MultiClass *CurMultiClass) {
1957 // Otherwise, a def inside a multiclass, add it to the multiclass.
1962 "' already defined in this multiclass!");
1981 // Copy the template arguments for the multiclass into the def.
2007 bool TGParser::ParseForeach(MultiClass *CurMultiClass) {
2135 bool TGParser::ParseTopLevelLet(MultiClass *CurMultiClass) {
2174 /// ParseMultiClass - Parse a multiclass definition.
2176 /// MultiClassInst ::= MULTICLASS ID TemplateArgList?
2185 assert(Lex.getCode() == tgtok::MultiClass && "Unexpected token");
2186 Lex.Lex(); // Eat the multiclass token.
2189 return TokError("expected identifier after multiclass for name");
2193 return TokError("multiclass '" + Name + "' already defined");
2195 CurMultiClass = MultiClasses[Name] = new MultiClass(Name,
2231 return TokError("expected '{' in multiclass definition");
2233 return TokError("expected ';' in multiclass definition");
2238 return TokError("multiclass must contain at least one def");
2243 return TokError("expected 'let', 'def' or 'defm' in multiclass body");
2261 InstantiateMulticlassDef(MultiClass &MC,
2293 // Make a trail of SMLocs from the multiclass instantiations.
2304 // though, so that uses in nested multiclass names don't get
2329 // any multiclass expansions, add the record to the RecordKeeper. If we are
2330 // currently in a multiclass, it means this defm appears inside a
2331 // multiclass and its name won't be fully resolvable until we see
2351 bool TGParser::ResolveMulticlassDefArgs(MultiClass &MC,
2385 bool TGParser::ResolveMulticlassDef(MultiClass &MC,
2403 "' already defined in this multiclass!");
2406 // Copy the template arguments for the multiclass into the new def.
2419 /// ParseDefm - Parse the instantiation of a multiclass.
2423 bool TGParser::ParseDefm(MultiClass *CurMultiClass) {
2439 // This record also inherits from a regular class (non-multiclass)?
2451 // To instantiate a multiclass, we need to first get the multiclass, then
2452 // instantiate each def contained in the multiclass with the SubClassRef
2454 MultiClass *MC = MultiClasses[Ref.Rec->getName()];
2455 assert(MC && "Didn't lookup multiclass correctly?");
2462 "more template args specified than multiclass expects");
2464 // Loop over all the def's in the multiclass, instantiating each one.
2490 // A defm can inherit from regular classes (non-multiclass) as
2548 bool TGParser::ParseObject(MultiClass *MC) {
2551 return TokError("Expected class, def, defm, multiclass or let definition");
2557 case tgtok::MultiClass: return ParseMultiClass();
2563 bool TGParser::ParseObjectList(MultiClass *MC) {