Init *Record::getValueInit(const std::string &FieldName) const {
const RecordVal *R = getValue(FieldName);
if (R == 0 || R->getValue() == 0)
- throw "Record '" + getName() + "' does not have a field named '" +
- FieldName + "!\n";
+ throw "Record `" + getName() + "' does not have a field named `" +
+ FieldName + "'!\n";
return R->getValue();
}
std::string Record::getValueAsString(const std::string &FieldName) const {
const RecordVal *R = getValue(FieldName);
if (R == 0 || R->getValue() == 0)
- throw "Record '" + getName() + "' does not have a field named '" +
- FieldName + "!\n";
+ throw "Record `" + getName() + "' does not have a field named `" +
+ FieldName + "'!\n";
if (const StringInit *SI = dynamic_cast<const StringInit*>(R->getValue()))
return SI->getValue();
- throw "Record '" + getName() + "', field '" + FieldName +
+ throw "Record `" + getName() + "', field `" + FieldName +
"' does not have a string initializer!";
}
BitsInit *Record::getValueAsBitsInit(const std::string &FieldName) const {
const RecordVal *R = getValue(FieldName);
if (R == 0 || R->getValue() == 0)
- throw "Record '" + getName() + "' does not have a field named '" +
- FieldName + "!\n";
+ throw "Record `" + getName() + "' does not have a field named `" +
+ FieldName + "'!\n";
if (BitsInit *BI = dynamic_cast<BitsInit*>(R->getValue()))
return BI;
- throw "Record '" + getName() + "', field '" + FieldName +
+ throw "Record `" + getName() + "', field `" + FieldName +
"' does not have a BitsInit initializer!";
}
ListInit *Record::getValueAsListInit(const std::string &FieldName) const {
const RecordVal *R = getValue(FieldName);
if (R == 0 || R->getValue() == 0)
- throw "Record '" + getName() + "' does not have a field named '" +
- FieldName + "!\n";
+ throw "Record `" + getName() + "' does not have a field named `" +
+ FieldName + "'!\n";
if (ListInit *LI = dynamic_cast<ListInit*>(R->getValue()))
return LI;
- throw "Record '" + getName() + "', field '" + FieldName +
+ throw "Record `" + getName() + "', field `" + FieldName +
"' does not have a list initializer!";
}
int Record::getValueAsInt(const std::string &FieldName) const {
const RecordVal *R = getValue(FieldName);
if (R == 0 || R->getValue() == 0)
- throw "Record '" + getName() + "' does not have a field named '" +
- FieldName + "!\n";
+ throw "Record `" + getName() + "' does not have a field named `" +
+ FieldName + "'!\n";
if (IntInit *II = dynamic_cast<IntInit*>(R->getValue()))
return II->getValue();
- throw "Record '" + getName() + "', field '" + FieldName +
+ throw "Record `" + getName() + "', field `" + FieldName +
"' does not have a list initializer!";
}
Record *Record::getValueAsDef(const std::string &FieldName) const {
const RecordVal *R = getValue(FieldName);
if (R == 0 || R->getValue() == 0)
- throw "Record '" + getName() + "' does not have a field named '" +
- FieldName + "!\n";
+ throw "Record `" + getName() + "' does not have a field named `" +
+ FieldName + "'!\n";
if (DefInit *DI = dynamic_cast<DefInit*>(R->getValue()))
return DI->getDef();
- throw "Record '" + getName() + "', field '" + FieldName +
+ throw "Record `" + getName() + "', field `" + FieldName +
"' does not have a list initializer!";
}
bool Record::getValueAsBit(const std::string &FieldName) const {
const RecordVal *R = getValue(FieldName);
if (R == 0 || R->getValue() == 0)
- throw "Record '" + getName() + "' does not have a field named '" +
- FieldName + "!\n";
+ throw "Record `" + getName() + "' does not have a field named `" +
+ FieldName + "'!\n";
if (BitInit *BI = dynamic_cast<BitInit*>(R->getValue()))
return BI->getValue();
- throw "Record '" + getName() + "', field '" + FieldName +
+ throw "Record `" + getName() + "', field `" + FieldName +
"' does not have a bit initializer!";
}
DagInit *Record::getValueAsDag(const std::string &FieldName) const {
const RecordVal *R = getValue(FieldName);
if (R == 0 || R->getValue() == 0)
- throw "Record '" + getName() + "' does not have a field named '" +
- FieldName + "!\n";
+ throw "Record `" + getName() + "' does not have a field named `" +
+ FieldName + "'!\n";
if (DagInit *DI = dynamic_cast<DagInit*>(R->getValue()))
return DI;
- throw "Record '" + getName() + "', field '" + FieldName +
+ throw "Record `" + getName() + "', field `" + FieldName +
"' does not have a dag initializer!";
}
RecordKeeper::getAllDerivedDefinitions(const std::string &ClassName) const {
Record *Class = Records.getClass(ClassName);
if (!Class)
- throw "ERROR: Couldn't find the '" + ClassName + "' class!\n";
+ throw "ERROR: Couldn't find the `" + ClassName + "' class!\n";
std::vector<Record*> Defs;
for (std::map<std::string, Record*>::const_iterator I = getDefs().begin(),