forked from OSchip/llvm-project
The semantic spelling enumeration should retain values to the spelling list indexes used by the attribute. The only attribute affected by this in practice is the OpenCLImageAccessAttr, which has duplicate semantic spellings that are automatically stripped.
We do not implicitly create an OpenCLImageAccessAttr, so this change only affects out of tree users. There is no way to test this behavior specifically that I can see, since this only affects implicit creation of attributes. Fixes PR22403. llvm-svn: 231803
This commit is contained in:
parent
063d725fd7
commit
9bf6b75f04
|
@ -1297,7 +1297,11 @@ CreateSemanticSpellings(const std::vector<FlattenedSpelling> &Spellings,
|
|||
Uniques.insert(EnumName);
|
||||
if (I != Spellings.begin())
|
||||
Ret += ",\n";
|
||||
Ret += " " + EnumName;
|
||||
// Duplicate spellings are not considered part of the semantic spelling
|
||||
// enumeration, but the spelling index and semantic spelling values are
|
||||
// meant to be equivalent, so we must specify a concrete value for each
|
||||
// enumerator.
|
||||
Ret += " " + EnumName + " = " + llvm::utostr(Idx);
|
||||
}
|
||||
Ret += "\n };\n\n";
|
||||
return Ret;
|
||||
|
|
Loading…
Reference in New Issue