forked from OSchip/llvm-project
Implement a correct copy constructor for Record. Now that we're using the ID number as a key in maps (for determinism), it is imperative that ID numbers be globally unique, even when we copy construct a Record.
This fixes some obscure failure cases involving registers defined inside multiclasses or foreach constructs that would not receive a unique ID, and would end up being omitted from the AsmMatcher tables. llvm-svn: 164251
This commit is contained in:
parent
7d3c9c0a2a
commit
1fc793e926
|
@ -1328,6 +1328,14 @@ public:
|
|||
TrackedRecords(records), TheInit(0) {
|
||||
init();
|
||||
}
|
||||
|
||||
// When copy-constructing a Record, we must still guarantee a globally unique
|
||||
// ID number. All other fields can be copied normally.
|
||||
Record(const Record &O) :
|
||||
ID(LastID++), Name(O.Name), Locs(O.Locs), TemplateArgs(O.TemplateArgs),
|
||||
Values(O.Values), SuperClasses(O.SuperClasses),
|
||||
TrackedRecords(O.TrackedRecords), TheInit(O.TheInit) { }
|
||||
|
||||
~Record() {}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue