mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
various cleanups to tblgen, patch by Garrison Venn!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121837 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -565,12 +565,8 @@ public:
|
||||
return I == SubtargetFeatures.end() ? 0 : I->second;
|
||||
}
|
||||
|
||||
RecordKeeper& getRecords() {
|
||||
return(Records);
|
||||
}
|
||||
|
||||
RecordKeeper &getRecords() const {
|
||||
return(Records);
|
||||
return Records;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1236,7 +1236,7 @@ class Record {
|
||||
|
||||
public:
|
||||
|
||||
// Constructs a record. See also RecordKeeper::createRecord.
|
||||
// Constructs a record.
|
||||
explicit Record(const std::string &N, SMLoc loc, RecordKeeper &records) :
|
||||
ID(LastID++), Name(N), Loc(loc), TrackedRecords(records) {}
|
||||
~Record() {}
|
||||
@@ -1324,7 +1324,7 @@ public:
|
||||
void resolveReferencesTo(const RecordVal *RV);
|
||||
|
||||
RecordKeeper &getRecords() const {
|
||||
return(TrackedRecords);
|
||||
return TrackedRecords;
|
||||
}
|
||||
|
||||
void dump() const;
|
||||
@@ -1466,12 +1466,6 @@ public:
|
||||
std::vector<Record*>
|
||||
getAllDerivedDefinitions(const std::string &ClassName) const;
|
||||
|
||||
// allocates and returns a record.
|
||||
Record *createRecord(const std::string &N, SMLoc loc) {
|
||||
return(new Record(N, loc, *this));
|
||||
}
|
||||
|
||||
|
||||
void dump() const;
|
||||
};
|
||||
|
||||
|
||||
@@ -1096,8 +1096,9 @@ Init *TGParser::ParseSimpleValue(Record *CurRec, RecTy *ItemType) {
|
||||
|
||||
// Create the new record, set it as CurRec temporarily.
|
||||
static unsigned AnonCounter = 0;
|
||||
Record *NewRec = Records.createRecord(
|
||||
"anonymous.val."+utostr(AnonCounter++),NameLoc);
|
||||
Record *NewRec = new Record("anonymous.val."+utostr(AnonCounter++),
|
||||
NameLoc,
|
||||
Records);
|
||||
SubClassReference SCRef;
|
||||
SCRef.RefLoc = NameLoc;
|
||||
SCRef.Rec = Class;
|
||||
@@ -1661,7 +1662,7 @@ bool TGParser::ParseDef(MultiClass *CurMultiClass) {
|
||||
Lex.Lex(); // Eat the 'def' token.
|
||||
|
||||
// Parse ObjectName and make a record for it.
|
||||
Record *CurRec = Records.createRecord(ParseObjectName(), DefLoc);
|
||||
Record *CurRec = new Record(ParseObjectName(), DefLoc, Records);
|
||||
|
||||
if (!CurMultiClass) {
|
||||
// Top-level def definition.
|
||||
@@ -1728,7 +1729,7 @@ bool TGParser::ParseClass() {
|
||||
return TokError("Class '" + CurRec->getName() + "' already defined");
|
||||
} else {
|
||||
// If this is the first reference to this class, create and add it.
|
||||
CurRec = Records.createRecord(Lex.getCurStrVal(), Lex.getLoc());
|
||||
CurRec = new Record(Lex.getCurStrVal(), Lex.getLoc(), Records);
|
||||
Records.addClass(CurRec);
|
||||
}
|
||||
Lex.Lex(); // eat the name.
|
||||
@@ -1975,7 +1976,7 @@ bool TGParser::ParseDefm(MultiClass *CurMultiClass) {
|
||||
}
|
||||
}
|
||||
|
||||
Record *CurRec = Records.createRecord(DefName, DefmPrefixLoc);
|
||||
Record *CurRec = new Record(DefName, DefmPrefixLoc, Records);
|
||||
|
||||
SubClassReference Ref;
|
||||
Ref.RefLoc = DefmPrefixLoc;
|
||||
|
||||
Reference in New Issue
Block a user