diff options
Diffstat (limited to 'utils/TableGen/Record.cpp')
-rw-r--r-- | utils/TableGen/Record.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/utils/TableGen/Record.cpp b/utils/TableGen/Record.cpp index 0e3593b6a1..55c998926c 100644 --- a/utils/TableGen/Record.cpp +++ b/utils/TableGen/Record.cpp @@ -1307,6 +1307,16 @@ void Record::resolveReferencesTo(const RecordVal *RV) { } } +RecordVal *Record::getDottedValue(StringRef Name) { + size_t pos = Name.find('.'); + if (pos == StringRef::npos) + return getValue(Name); + RecordVal *RV = getValue(Name.substr(0, pos)); + if (!RV) return 0; + DefInit *DI = dynamic_cast<DefInit*>(RV->getValue()); + if (!DI) return 0; + return DI->getDef()->getDottedValue(Name.substr(pos+1)); +} void Record::dump() const { errs() << *this; } |