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 {
113
113
114
114
// Returns the name of the directive formatted for output. Whitespace are
115
115
// replaced with underscores.
116
- static std::string getFormattedName (const Record *R) {
117
- StringRef Name = R->getValueAsString (" name" );
116
+ static std::string formatName (StringRef Name) {
118
117
std::string N = Name.str ();
119
118
llvm::replace (N, ' ' , ' _' );
120
119
return N;
121
120
}
122
121
123
- std::string getFormattedName () const { return getFormattedName (Def); }
122
+ std::string getFormattedName () const {
123
+ return formatName (Def->getValueAsString (" name" ));
124
+ }
124
125
125
126
bool isDefault () const { return Def->getValueAsBit (" isDefault" ); }
126
127
127
128
// Returns the record name.
128
129
StringRef getRecordName () const { return Def->getName (); }
129
130
131
+ const Record *getRecord () const { return Def; }
132
+
130
133
protected:
131
134
const Record *Def;
132
135
};
You can’t perform that action at this time.
0 commit comments