Skip to content

Commit

Permalink
Add Record Init
Browse files Browse the repository at this point in the history
Add an init function to be shared among Record constructors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142501 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
greened committed Oct 19, 2011
1 parent e22b321 commit f7931b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/llvm/TableGen/Record.h
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,7 @@ class Record {

DefInit *TheInit;

void init();
void checkName();

public:
Expand Down
4 changes: 4 additions & 0 deletions lib/TableGen/Record.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1684,6 +1684,10 @@ void RecordVal::print(raw_ostream &OS, bool PrintSem) const {

unsigned Record::LastID = 0;

void Record::init() {
checkName();
}

void Record::checkName() {
// Ensure the record name has string type.
const TypedInit *TypedName = dynamic_cast<const TypedInit *>(Name);
Expand Down

0 comments on commit f7931b7

Please sign in to comment.