mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-02 22:00:04 +00:00
[NFC][Attr TableGen] Emit Spelling Enum for Attr types if there >1
Discovered in a downstream, it is often useful to have slightly different semantics for an attribute based on its namespace, however our spelling infrastructure doesn't consider namespace when deciding to elide the enum list. The result is that the solution for a case where an attribute has slightly different semantics based on a namespace requires checking against the integer value, which is fragile. This patch makes us always emit the spelling enum if there is more than 1 and we're generating the header. Differential Revision: https://reviews.llvm.org/D76289
This commit is contained in:
parent
be9e3d9416
commit
661c950630
@ -2329,7 +2329,7 @@ static void emitAttributes(RecordKeeper &Records, raw_ostream &OS,
|
||||
SemanticSpellingMap SemanticToSyntacticMap;
|
||||
|
||||
std::string SpellingEnum;
|
||||
if (!ElideSpelling)
|
||||
if (Spellings.size() > 1)
|
||||
SpellingEnum = CreateSemanticSpellings(Spellings, SemanticToSyntacticMap);
|
||||
if (Header)
|
||||
OS << SpellingEnum;
|
||||
|
Loading…
Reference in New Issue
Block a user