[llvm] r256299 - Add an OperandNamespace field to Target.td's Operand.

Dan Gohman via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 22 15:37:38 PST 2015


Author: djg
Date: Tue Dec 22 17:37:37 2015
New Revision: 256299

URL: http://llvm.org/viewvc/llvm-project?rev=256299&view=rev
Log:
Add an OperandNamespace field to Target.td's Operand.

For targets to add their own operand types as needed, as advertised in
Operand's comment, they need to be able to specify an alternate namespace
for OperandType names too. This matches the RegisterOperand class.

Modified:
    llvm/trunk/include/llvm/Target/Target.td
    llvm/trunk/utils/TableGen/CodeGenInstruction.cpp

Modified: llvm/trunk/include/llvm/Target/Target.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/Target.td?rev=256299&r1=256298&r2=256299&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/Target.td (original)
+++ llvm/trunk/include/llvm/Target/Target.td Tue Dec 22 17:37:37 2015
@@ -620,6 +620,7 @@ class Operand<ValueType ty> : DAGOperand
   string EncoderMethod = "";
   string DecoderMethod = "";
   bit hasCompleteDecoder = 1;
+  string OperandNamespace = "MCOI";
   string OperandType = "OPERAND_UNKNOWN";
   dag MIOperandInfo = (ops);
 

Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenInstruction.cpp?rev=256299&r1=256298&r2=256299&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenInstruction.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeGenInstruction.cpp Tue Dec 22 17:37:37 2015
@@ -78,6 +78,7 @@ CGIOperandList::CGIOperandList(Record *R
     } else if (Rec->isSubClassOf("Operand")) {
       PrintMethod = Rec->getValueAsString("PrintMethod");
       OperandType = Rec->getValueAsString("OperandType");
+      OperandNamespace = Rec->getValueAsString("OperandNamespace");
       // If there is an explicit encoder method, use it.
       EncoderMethod = Rec->getValueAsString("EncoderMethod");
       MIOpInfo = Rec->getValueAsDag("MIOperandInfo");




More information about the llvm-commits mailing list