Lines Matching refs:Expr

30   void apply(SetTheory &ST, DagInit *Expr, RecSet &Elts,
32 ST.evaluate(Expr->arg_begin(), Expr->arg_end(), Elts, Loc);
38 void apply(SetTheory &ST, DagInit *Expr, RecSet &Elts,
40 if (Expr->arg_size() < 2)
42 Expr->getAsString());
44 ST.evaluate(*Expr->arg_begin(), Add, Loc);
45 ST.evaluate(Expr->arg_begin() + 1, Expr->arg_end(), Sub, Loc);
54 void apply(SetTheory &ST, DagInit *Expr, RecSet &Elts,
56 if (Expr->arg_size() != 2)
58 Expr->getAsString());
60 ST.evaluate(Expr->arg_begin()[0], S1, Loc);
61 ST.evaluate(Expr->arg_begin()[1], S2, Loc);
70 virtual void apply2(SetTheory &ST, DagInit *Expr, RecSet &Set, int64_t N,
73 void apply(SetTheory &ST, DagInit *Expr, RecSet &Elts,
75 if (Expr->arg_size() != 2)
77 Expr->getAsString());
79 ST.evaluate(Expr->arg_begin()[0], Set, Loc);
80 IntInit *II = dyn_cast<IntInit>(Expr->arg_begin()[1]);
83 Expr->getAsString());
84 apply2(ST, Expr, Set, II->getValue(), Elts, Loc);
90 void apply2(SetTheory &ST, DagInit *Expr, RecSet &Set, int64_t N,
94 Expr->getAsString());
102 void apply2(SetTheory &ST, DagInit *Expr, RecSet &Set, int64_t N,
106 Expr->getAsString());
119 void apply2(SetTheory &ST, DagInit *Expr, RecSet &Set, int64_t N,
137 void apply2(SetTheory &ST, DagInit *Expr, RecSet &Set, int64_t N,
141 Expr->getAsString());
149 void apply(SetTheory &ST, DagInit *Expr, RecSet &Elts,
152 SmallVector<RecSet, 4> Args(Expr->getNumArgs());
154 for (unsigned i = 0, e = Expr->getNumArgs(); i != e; ++i) {
155 ST.evaluate(Expr->getArg(i), Args[i], Loc);
160 for (unsigned i = 0, e = Expr->getNumArgs(); i != e; ++i)
168 void apply(SetTheory &ST, DagInit *Expr, RecSet &Elts,
171 if (Expr->arg_size() > 4)
173 Expr->getAsString());
174 else if (Expr->arg_size() == 4) {
175 if (IntInit *II = dyn_cast<IntInit>(Expr->arg_begin()[3])) {
179 Expr->getAsString());
183 if (StringInit *SI = dyn_cast<StringInit>(Expr->arg_begin()[0]))
186 PrintFatalError(Loc, "Format must be a string: " + Expr->getAsString());
189 if (IntInit *II = dyn_cast<IntInit>(Expr->arg_begin()[1]))
192 PrintFatalError(Loc, "From must be an integer: " + Expr->getAsString());
196 if (IntInit *II = dyn_cast<IntInit>(Expr->arg_begin()[2]))
199 PrintFatalError(Loc, "To must be an integer: " + Expr->getAsString());
204 cast<DefInit>(Expr->getOperator())->getDef()->getRecords();
218 Expr->getAsString());
272 void SetTheory::evaluate(Init *Expr, RecSet &Elts, ArrayRef<SMLoc> Loc) {
274 if (DefInit *Def = dyn_cast<DefInit>(Expr)) {
282 if (ListInit *LI = dyn_cast<ListInit>(Expr))
286 DagInit *DagExpr = dyn_cast<DagInit>(Expr);
288 PrintFatalError(Loc, "Invalid set element: " + Expr->getAsString());
291 PrintFatalError(Loc, "Bad set expression: " + Expr->getAsString());
294 PrintFatalError(Loc, "Unknown set operator: " + Expr->getAsString());