aboutsummaryrefslogtreecommitdiff
path: root/clang/utils/TableGen
diff options
context:
space:
mode:
Diffstat (limited to 'clang/utils/TableGen')
-rw-r--r--clang/utils/TableGen/ClangAttrEmitter.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp
index 1342e1a..183952a 100644
--- a/clang/utils/TableGen/ClangAttrEmitter.cpp
+++ b/clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -3078,6 +3078,17 @@ static void emitAttributes(const RecordKeeper &Records, raw_ostream &OS,
OS << " {\n";
+ // The generator puts the arguments for each attribute in the child class,
+ // even if those are set in the inherited attribute class (in the TD
+ // file). This means I cannot access those from the parent class, and have
+ // to do this weirdness. Maybe the generator should be changed to
+ // arguments are put in the class they are declared in inside the TD file?
+ if (HLSLSemantic) {
+ OS << " if (SemanticExplicitIndex)\n";
+ OS << " setSemanticIndex(SemanticIndex);\n";
+ OS << " setTargetDecl(Target);\n";
+ }
+
for (auto const &ai : Args) {
if (!shouldEmitArg(ai))
continue;