]> granicus.if.org Git - clang/commitdiff
The semantic spelling enumeration should retain values to the spelling list indexes...
authorAaron Ballman <aaron@aaronballman.com>
Tue, 10 Mar 2015 17:19:18 +0000 (17:19 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Tue, 10 Mar 2015 17:19:18 +0000 (17:19 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231803 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/ClangAttrEmitter.cpp

index 6369c342ce773466a18e75dfe924494d307c0e7a..16b38a37ca98146c36b7b183e58f9b3e978da9f5 100644 (file)
@@ -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;