mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
add support for emitting register classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7473 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -460,6 +460,18 @@ std::ostream &operator<<(std::ostream &OS, const Record &R) {
|
||||
return OS << "}\n";
|
||||
}
|
||||
|
||||
/// getValueInit - Return the initializer for a value with the specified name,
|
||||
/// or throw an exception if the field does not exist.
|
||||
///
|
||||
Init *Record::getValueInit(const std::string &FieldName) const {
|
||||
const RecordVal *R = getValue(FieldName);
|
||||
if (R == 0 || R->getValue() == 0)
|
||||
throw "Record '" + R->getName() + "' does not have a field named '" +
|
||||
FieldName + "!\n";
|
||||
return R->getValue();
|
||||
}
|
||||
|
||||
|
||||
/// getValueAsString - This method looks up the specified field and returns its
|
||||
/// value as a string, throwing an exception if the field does not exist or if
|
||||
/// the value is not a string.
|
||||
|
Reference in New Issue
Block a user