mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-30 02:25:19 +00:00
Add Value Accessors
Add accessors to get Record values by Init name. This lets us look up Record values whose names are not yet fully resolved. More work toward paste. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142496 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1726,6 +1726,18 @@ void Record::setName(const std::string &Name) {
|
||||
setName(StringInit::get(Name));
|
||||
}
|
||||
|
||||
const RecordVal *Record::getValue(Init *Name) const {
|
||||
for (unsigned i = 0, e = Values.size(); i != e; ++i)
|
||||
if (Values[i].getNameInit() == Name) return &Values[i];
|
||||
return 0;
|
||||
}
|
||||
|
||||
RecordVal *Record::getValue(Init *Name) {
|
||||
for (unsigned i = 0, e = Values.size(); i != e; ++i)
|
||||
if (Values[i].getNameInit() == Name) return &Values[i];
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// resolveReferencesTo - If anything in this record refers to RV, replace the
|
||||
/// reference to RV with the RHS of RV. If RV is null, we resolve all possible
|
||||
/// references.
|
||||
|
Reference in New Issue
Block a user