llvm.org GIT mirror llvm / 79175db
TableGen: Allow dag operators to be resolved late Change-Id: I51bb80fd5c48c8ac441ab11e43d43c1b91b4b590 Differential revision: https://reviews.llvm.org/D44113 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327495 91177308-0d34-0410-b5e6-96231b3b80d8 Nicolai Haehnle 1 year, 7 months ago
2 changed file(s) with 22 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
858858 if (LHSs && RHSs) {
859859 DefInit *LOp = dyn_cast(LHSs->getOperator());
860860 DefInit *ROp = dyn_cast(RHSs->getOperator());
861 if (!LOp || !ROp || LOp->getDef() != ROp->getDef())
862 PrintFatalError("Concated Dag operators do not match!");
861 if (!LOp || !ROp)
862 break;
863 if (LOp->getDef() != ROp->getDef()) {
864 PrintFatalError(Twine("Concatenated Dag operators do not match: '") +
865 LHSs->getAsString() + "' vs. '" + RHSs->getAsString() +
866 "'");
867 }
863868 SmallVector Args;
864869 SmallVector ArgNames;
865870 for (unsigned i = 0, e = LHSs->getNumArgs(); i != e; ++i) {
3939 // CHECK: dag d1 = (ops 1, ?:$name1, 2, 3);
4040 // CHECK: }
4141
42 def ops;
42 // CHECK: def E0 {
43 // CHECK: dag ret = (ops 1, 2);
44 // CHECK: }
45
46 class Ops;
47
48 def ops : Ops;
4349
4450 class Node {
4551 int Val = val;
99105
100106 def D {
101107 dag d1 = !con((ops 1), (ops $name1), (ops), (ops 2, 3));
102 }
108 }
109
110 class E {
111 // Allow concatenation of DAG nodes with operators from template arguments.
112 dag ret = !con((op 1), (op 2));
113 }
114
115 def E0 : E;