[PATCH] D18242: [TableGen] AsmMatcher: support for default values for optional operands

Ahmed Bougacha via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 13:35:01 PDT 2016


ab added inline comments.

================
Comment at: include/llvm/Target/Target.td:628-630
@@ -622,1 +627,5 @@
+  ///   std::unique_ptr<MCParsedAsmOperand> defaultFooOperands(
+  ///           unsigned Opcode,
+  ///           const OperandVector &Operands) const;
+  string DefaultMethod = ?;
 }
----------------
> I added Opcode and Operands to arguments list because this arguments seems to be useful in defaultMethod. It is not hard to imagine situation when default value for operand differs depending on instruction opcode or other operands presented in instruction. But if you think that they are unnecessary I can remove them.

Eh, if you have a patch in mind that would use them, OK, but otherwise, what do you think of leaving them out, and adding them when they turn out to be necessary?

> There is always first operand in OperandVector - instruction mnemonic.

You're right, forgot about that!


http://reviews.llvm.org/D18242





More information about the llvm-commits mailing list