@@ -152,7 +152,7 @@ bool TGParser::AddSubClass(Record *CurRec, SubClassReference &SubClass) {
152
152
if (AddValue (CurRec, SubClass.RefRange .Start , Val))
153
153
return true ;
154
154
155
- const std::vector <Init *> & TArgs = SC->getTemplateArgs ();
155
+ ArrayRef <Init *> TArgs = SC->getTemplateArgs ();
156
156
157
157
// Ensure that an appropriate number of template arguments are specified.
158
158
if (TArgs.size () < SubClass.TemplateArgs .size ())
@@ -228,7 +228,7 @@ bool TGParser::AddSubMultiClass(MultiClass *CurMC,
228
228
CurMC->DefPrototypes .push_back (std::move (NewDef));
229
229
}
230
230
231
- const std::vector <Init *> & SMCTArgs = SMC->Rec .getTemplateArgs ();
231
+ ArrayRef <Init *> SMCTArgs = SMC->Rec .getTemplateArgs ();
232
232
233
233
// Ensure that an appropriate number of template arguments are
234
234
// specified.
@@ -1641,7 +1641,7 @@ std::vector<Init*> TGParser::ParseValueList(Record *CurRec, Record *ArgsRec,
1641
1641
RecTy *ItemType = EltTy;
1642
1642
unsigned int ArgN = 0 ;
1643
1643
if (ArgsRec && !EltTy) {
1644
- const std::vector <Init *> & TArgs = ArgsRec->getTemplateArgs ();
1644
+ ArrayRef <Init *> TArgs = ArgsRec->getTemplateArgs ();
1645
1645
if (TArgs.empty ()) {
1646
1646
TokError (" template argument provided to non-template class" );
1647
1647
return std::vector<Init*>();
@@ -1662,7 +1662,7 @@ std::vector<Init*> TGParser::ParseValueList(Record *CurRec, Record *ArgsRec,
1662
1662
Lex.Lex (); // Eat the comma
1663
1663
1664
1664
if (ArgsRec && !EltTy) {
1665
- const std::vector <Init *> & TArgs = ArgsRec->getTemplateArgs ();
1665
+ ArrayRef <Init *> TArgs = ArgsRec->getTemplateArgs ();
1666
1666
if (ArgN >= TArgs.size ()) {
1667
1667
TokError (" too many template arguments" );
1668
1668
return std::vector<Init*>();
@@ -2313,13 +2313,11 @@ bool TGParser::ParseMultiClass() {
2313
2313
return false ;
2314
2314
}
2315
2315
2316
- Record *TGParser::
2317
- InstantiateMulticlassDef (MultiClass &MC,
2318
- Record *DefProto,
2319
- Init *&DefmPrefix,
2320
- SMRange DefmPrefixRange,
2321
- const std::vector<Init *> &TArgs,
2322
- std::vector<Init *> &TemplateVals) {
2316
+ Record *TGParser::InstantiateMulticlassDef (MultiClass &MC, Record *DefProto,
2317
+ Init *&DefmPrefix,
2318
+ SMRange DefmPrefixRange,
2319
+ ArrayRef<Init *> TArgs,
2320
+ std::vector<Init *> &TemplateVals) {
2323
2321
// We need to preserve DefProto so it can be reused for later
2324
2322
// instantiations, so create a new Record to inherit from it.
2325
2323
@@ -2437,11 +2435,9 @@ InstantiateMulticlassDef(MultiClass &MC,
2437
2435
return CurRec.release ();
2438
2436
}
2439
2437
2440
- bool TGParser::ResolveMulticlassDefArgs (MultiClass &MC,
2441
- Record *CurRec,
2442
- SMLoc DefmPrefixLoc,
2443
- SMLoc SubClassLoc,
2444
- const std::vector<Init *> &TArgs,
2438
+ bool TGParser::ResolveMulticlassDefArgs (MultiClass &MC, Record *CurRec,
2439
+ SMLoc DefmPrefixLoc, SMLoc SubClassLoc,
2440
+ ArrayRef<Init *> TArgs,
2445
2441
std::vector<Init *> &TemplateVals,
2446
2442
bool DeleteArgs) {
2447
2443
// Loop over all of the template arguments, setting them to the specified
@@ -2540,7 +2536,7 @@ bool TGParser::ParseDefm(MultiClass *CurMultiClass) {
2540
2536
std::vector<Init*> &TemplateVals = Ref.TemplateArgs ;
2541
2537
2542
2538
// Verify that the correct number of template arguments were specified.
2543
- const std::vector <Init *> & TArgs = MC->Rec .getTemplateArgs ();
2539
+ ArrayRef <Init *> TArgs = MC->Rec .getTemplateArgs ();
2544
2540
if (TArgs.size () < TemplateVals.size ())
2545
2541
return Error (SubClassLoc,
2546
2542
" more template args specified than multiclass expects" );
0 commit comments