return VarInit::get(MCName, RV->getType());
}
}
-
+ assert(CurRec && "NULL pointer");
if (Record *D = (CurRec->getRecords()).getDef(Name))
return DefInit::get(D);
std::string Result = "(" + Val->getAsString();
if (!ValName.empty())
Result += ":" + ValName;
- if (Args.size()) {
+ if (!Args.empty()) {
Result += " " + Args[0]->getAsString();
if (!ArgNames[0].empty()) Result += ":$" + ArgNames[0];
for (unsigned i = 1, e = Args.size(); i != e; ++i) {
}
void Record::setName(Init *NewName) {
- if (TrackedRecords.getDef(Name->getAsUnquotedString()) == this) {
- TrackedRecords.removeDef(Name->getAsUnquotedString());
- TrackedRecords.addDef(this);
- } else if (TrackedRecords.getClass(Name->getAsUnquotedString()) == this) {
- TrackedRecords.removeClass(Name->getAsUnquotedString());
- TrackedRecords.addClass(this);
- } // Otherwise this isn't yet registered.
Name = NewName;
checkName();
// DO NOT resolve record values to the name at this point because
std::vector<Record*> Defs;
for (const auto &D : getDefs())
if (D.second->isSubClassOf(Class))
- Defs.push_back(D.second);
+ Defs.push_back(D.second.get());
return Defs;
}