Add an OperandNamespace field to Target.td's Operand.
authorDan Gohman <dan433584@gmail.com>
Tue, 22 Dec 2015 23:37:37 +0000 (23:37 +0000)
committerDan Gohman <dan433584@gmail.com>
Tue, 22 Dec 2015 23:37:37 +0000 (23:37 +0000)
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.

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

include/llvm/Target/Target.td
utils/TableGen/CodeGenInstruction.cpp

index 859e21b1957160deeda477979e403f5a10e191d4..2b796d15fccd7b85a33288707aca4ad71e2e6bc9 100644 (file)
@@ -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);
 
index e83d5033b1826c0f07a505b8f8970f30e7244366..366e8ec7fac15a70a23d58b225df626ad17ec98b 100644 (file)
@@ -78,6 +78,7 @@ CGIOperandList::CGIOperandList(Record *R) : TheDef(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");