Nathan =?utf-8?q?Gauër?= <[email protected]>,
Nathan =?utf-8?q?Gauër?= <[email protected]>,
Nathan =?utf-8?q?Gauër?= <[email protected]>,
Nathan =?utf-8?q?Gauër?= <[email protected]>,
Nathan =?utf-8?q?Gauër?= <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>


================
@@ -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";
+      }
+
----------------
tex3d wrote:

Can you add the needed fields manually to the parent class rather than 
declaring them through the .td file?

In any case, I think there should just be one semantic attribute representing 
the basic language element and capturing the string identifier exactly as 
written by the user, rather than having one for each system value, which would 
also solve this.
These could be interpreted into elements as I suggested when diagnosing an 
entry point decl, since only at that point are all relevant facts known to 
perform correct diagnostics.

I don't think early interpretation of properties like explicit index, or using 
new semantic attributes as element attributes, buys us anything other than 
additional diagnostic and attribute complexity.

https://github.com/llvm/llvm-project/pull/159047
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to