summaryrefslogtreecommitdiffstats
path: root/clang/utils/TableGen
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2015-03-10 17:19:18 +0000
committerAaron Ballman <aaron@aaronballman.com>2015-03-10 17:19:18 +0000
commit9bf6b75f04475b64b082b3ed66c665205f8e92f0 (patch)
tree93956f6ad0e22666a9f2f65a0098d7542abe3491 /clang/utils/TableGen
parent063d725fd78bbdeff0c5eecab3d1cfa906bd5d12 (diff)
downloadbcm5719-llvm-9bf6b75f04475b64b082b3ed66c665205f8e92f0.tar.gz
bcm5719-llvm-9bf6b75f04475b64b082b3ed66c665205f8e92f0.zip
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
Diffstat (limited to 'clang/utils/TableGen')
-rw-r--r--clang/utils/TableGen/ClangAttrEmitter.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp
index 6369c342ce7..16b38a37ca9 100644
--- a/clang/utils/TableGen/ClangAttrEmitter.cpp
+++ b/clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -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;
OpenPOWER on IntegriCloud