class TGParser {
TGLexer Lex;
std::vector<std::vector<LetRecord> > LetStack;
- std::map<std::string, MultiClass*> MultiClasses;
+ std::map<std::string, std::unique_ptr<MultiClass>> MultiClasses;
/// Loops - Keep track of any foreach loops we are within.
///
private: // Semantic analysis methods.
bool AddValue(Record *TheRec, SMLoc Loc, const RecordVal &RV);
bool SetValue(Record *TheRec, SMLoc Loc, Init *ValName,
- const std::vector<unsigned> &BitList, Init *V);
+ ArrayRef<unsigned> BitList, Init *V,
+ bool AllowSelfAssignment = false);
bool SetValue(Record *TheRec, SMLoc Loc, const std::string &ValName,
- const std::vector<unsigned> &BitList, Init *V) {
- return SetValue(TheRec, Loc, StringInit::get(ValName), BitList, V);
+ ArrayRef<unsigned> BitList, Init *V,
+ bool AllowSelfAssignment = false) {
+ return SetValue(TheRec, Loc, StringInit::get(ValName), BitList, V,
+ AllowSelfAssignment);
}
bool AddSubClass(Record *Rec, SubClassReference &SubClass);
bool AddSubMultiClass(MultiClass *CurMC,
bool ParseObject(MultiClass *MC);
bool ParseClass();
bool ParseMultiClass();
- Record *InstantiateMulticlassDef(MultiClass &MC,
- Record *DefProto,
- Init *&DefmPrefix,
- SMRange DefmPrefixRange);
- bool ResolveMulticlassDefArgs(MultiClass &MC,
- Record *DefProto,
- SMLoc DefmPrefixLoc,
- SMLoc SubClassLoc,
- const std::vector<Init *> &TArgs,
+ Record *InstantiateMulticlassDef(MultiClass &MC, Record *DefProto,
+ Init *&DefmPrefix, SMRange DefmPrefixRange,
+ ArrayRef<Init *> TArgs,
+ std::vector<Init *> &TemplateVals);
+ bool ResolveMulticlassDefArgs(MultiClass &MC, Record *DefProto,
+ SMLoc DefmPrefixLoc, SMLoc SubClassLoc,
+ ArrayRef<Init *> TArgs,
std::vector<Init *> &TemplateVals,
bool DeleteArgs);
bool ResolveMulticlassDef(MultiClass &MC,