File tree Expand file tree Collapse file tree 2 files changed +235
-229
lines changed Expand file tree Collapse file tree 2 files changed +235
-229
lines changed Original file line number Diff line number Diff line change @@ -113,20 +113,23 @@ class BaseRecord {
113113
114114 // Returns the name of the directive formatted for output. Whitespace are
115115 // replaced with underscores.
116- static std::string getFormattedName (const Record *R) {
117- StringRef Name = R->getValueAsString (" name" );
116+ static std::string formatName (StringRef Name) {
118117 std::string N = Name.str ();
119118 llvm::replace (N, ' ' , ' _' );
120119 return N;
121120 }
122121
123- std::string getFormattedName () const { return getFormattedName (Def); }
122+ std::string getFormattedName () const {
123+ return formatName (Def->getValueAsString (" name" ));
124+ }
124125
125126 bool isDefault () const { return Def->getValueAsBit (" isDefault" ); }
126127
127128 // Returns the record name.
128129 StringRef getRecordName () const { return Def->getName (); }
129130
131+ const Record *getRecord () const { return Def; }
132+
130133protected:
131134 const Record *Def;
132135};
You can’t perform that action at this time.
0 commit comments