Intel SPMD Program Compiler  1.12.0
stmt.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2010-2013, Intel Corporation
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without
6  modification, are permitted provided that the following conditions are
7  met:
8 
9  * Redistributions of source code must retain the above copyright
10  notice, this list of conditions and the following disclaimer.
11 
12  * Redistributions in binary form must reproduce the above copyright
13  notice, this list of conditions and the following disclaimer in the
14  documentation and/or other materials provided with the distribution.
15 
16  * Neither the name of Intel Corporation nor the names of its
17  contributors may be used to endorse or promote products derived from
18  this software without specific prior written permission.
19 
20 
21  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22  IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
25  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33 
34 /** @file stmt.h
35  @brief File with declarations for classes related to statements in the language
36 */
37 
38 #ifndef ISPC_STMT_H
39 #define ISPC_STMT_H 1
40 
41 #include "ast.h"
42 #include "ispc.h"
43 
44 /** @brief Interface class for statements in the ispc language.
45 
46  This abstract base-class encapsulates methods that AST nodes for
47  statements in the language must implement.
48  */
49 class Stmt : public ASTNode {
50  public:
51  Stmt(SourcePos p, unsigned scid) : ASTNode(p, scid) {}
52 
53  static inline bool classof(Stmt const *) { return true; }
54  static inline bool classof(ASTNode const *N) { return N->getValueID() > MaxExprID; }
55 
56  /** Emit LLVM IR for the statement, using the FunctionEmitContext to create the
57  necessary instructions.
58  */
59  virtual void EmitCode(FunctionEmitContext *ctx) const = 0;
60 
61  /** Print a representation of the statement (and any children AST
62  nodes) to standard output. This method is used for debuggins. */
63  virtual void Print(int indent) const = 0;
64 
65  // Redeclare these methods with Stmt * return values, rather than
66  // ASTNode *s, as in the original ASTNode declarations of them. We'll
67  // also provide a default implementation of Optimize(), since most
68  // Stmts don't have anything to do here.
69  virtual Stmt *Optimize();
70  virtual Stmt *TypeCheck() = 0;
71 };
72 
73 /** @brief Statement representing a single expression */
74 class ExprStmt : public Stmt {
75  public:
76  ExprStmt(Expr *expr, SourcePos pos);
77 
78  static inline bool classof(ExprStmt const *) { return true; }
79  static inline bool classof(ASTNode const *N) { return N->getValueID() == ExprStmtID; }
80 
81  void EmitCode(FunctionEmitContext *ctx) const;
82  void Print(int indent) const;
83 
84  Stmt *TypeCheck();
85  int EstimateCost() const;
86 
88 };
89 
91  VariableDeclaration(Symbol *s = NULL, Expr *i = NULL) {
92  sym = s;
93  init = i;
94  }
97 };
98 
99 /** @brief Statement representing a single declaration (which in turn may declare
100  a number of variables. */
101 class DeclStmt : public Stmt {
102  public:
103  DeclStmt(const std::vector<VariableDeclaration> &v, SourcePos pos);
104 
105  static inline bool classof(DeclStmt const *) { return true; }
106  static inline bool classof(ASTNode const *N) { return N->getValueID() == DeclStmtID; }
107 
108  void EmitCode(FunctionEmitContext *ctx) const;
109  void Print(int indent) const;
110 
111  Stmt *Optimize();
112  Stmt *TypeCheck();
113  int EstimateCost() const;
114 
115  std::vector<VariableDeclaration> vars;
116 };
117 
118 /** @brief Statement representing a single if statement, possibly with an
119  else clause. */
120 class IfStmt : public Stmt {
121  public:
122  IfStmt(Expr *testExpr, Stmt *trueStmts, Stmt *falseStmts, bool doAllCheck, SourcePos pos);
123 
124  static inline bool classof(IfStmt const *) { return true; }
125  static inline bool classof(ASTNode const *N) { return N->getValueID() == IfStmtID; }
126 
127  void EmitCode(FunctionEmitContext *ctx) const;
128  void Print(int indent) const;
129 
130  Stmt *TypeCheck();
131  int EstimateCost() const;
132 
133  // @todo these are only public for lHasVaryingBreakOrContinue(); would
134  // be nice to clean that up...
135  /** Expression giving the 'if' test. */
137  /** Statements to run if the 'if' test returns a true value */
139  /** Statements to run if the 'if' test returns a false value */
141 
142  private:
143  /** This value records if this was a 'coherent' if statement in the
144  source and thus, if the emitted code should check to see if all
145  active program instances want to follow just one of the 'true' or
146  'false' blocks. */
147  const bool doAllCheck;
148 
149  void emitMaskedTrueAndFalse(FunctionEmitContext *ctx, llvm::Value *oldMask, llvm::Value *test) const;
150  void emitVaryingIf(FunctionEmitContext *ctx, llvm::Value *test) const;
151  void emitMaskAllOn(FunctionEmitContext *ctx, llvm::Value *test, llvm::BasicBlock *bDone) const;
152  void emitMaskMixed(FunctionEmitContext *ctx, llvm::Value *oldMask, llvm::Value *test,
153  llvm::BasicBlock *bDone) const;
154 };
155 
156 /** @brief Statement implementation representing a 'do' statement in the
157  program.
158  */
159 class DoStmt : public Stmt {
160  public:
161  DoStmt(Expr *testExpr, Stmt *bodyStmts, bool doCoherentCheck, SourcePos pos);
162 
163  static inline bool classof(DoStmt const *) { return true; }
164  static inline bool classof(ASTNode const *N) { return N->getValueID() == DoStmtID; }
165 
166  void EmitCode(FunctionEmitContext *ctx) const;
167  void Print(int indent) const;
168 
169  Stmt *TypeCheck();
170  int EstimateCost() const;
171 
174  const bool doCoherentCheck;
175 };
176 
177 /** @brief Statement implementation for 'for' loops (as well as for 'while'
178  loops).
179  */
180 class ForStmt : public Stmt {
181  public:
182  ForStmt(Stmt *initializer, Expr *testExpr, Stmt *stepStatements, Stmt *bodyStatements, bool doCoherentCheck,
183  SourcePos pos);
184 
185  static inline bool classof(ForStmt const *) { return true; }
186  static inline bool classof(ASTNode const *N) { return N->getValueID() == ForStmtID; }
187 
188  void EmitCode(FunctionEmitContext *ctx) const;
189  void Print(int indent) const;
190 
191  Stmt *TypeCheck();
192  int EstimateCost() const;
193 
194  /** 'for' statment initializer; may be NULL, indicating no intitializer */
196  /** expression that returns a value indicating whether the loop should
197  continue for the next iteration */
199  /** Statements to run at the end of the loop for the loop step, before
200  the test expression is evaluated. */
202  /** Loop body statements */
204  const bool doCoherentCheck;
205 };
206 
207 /** @brief Statement implementation for a break statement in the
208  program. */
209 class BreakStmt : public Stmt {
210  public:
212 
213  static inline bool classof(BreakStmt const *) { return true; }
214  static inline bool classof(ASTNode const *N) { return N->getValueID() == BreakStmtID; }
215 
216  void EmitCode(FunctionEmitContext *ctx) const;
217  void Print(int indent) const;
218 
219  Stmt *TypeCheck();
220  int EstimateCost() const;
221 };
222 
223 /** @brief Statement implementation for a continue statement in the
224  program. */
225 class ContinueStmt : public Stmt {
226  public:
228 
229  static inline bool classof(ContinueStmt const *) { return true; }
230  static inline bool classof(ASTNode const *N) { return N->getValueID() == ContinueStmtID; }
231 
232  void EmitCode(FunctionEmitContext *ctx) const;
233  void Print(int indent) const;
234 
235  Stmt *TypeCheck();
236  int EstimateCost() const;
237 };
238 
239 /** @brief Statement implementation for parallel 'foreach' loops.
240  */
241 class ForeachStmt : public Stmt {
242  public:
243  ForeachStmt(const std::vector<Symbol *> &loopVars, const std::vector<Expr *> &startExprs,
244  const std::vector<Expr *> &endExprs, Stmt *bodyStatements, bool tiled, SourcePos pos);
245 
246  static inline bool classof(ForeachStmt const *) { return true; }
247  static inline bool classof(ASTNode const *N) { return N->getValueID() == ForeachStmtID; }
248 
249  void EmitCode(FunctionEmitContext *ctx) const;
250  void Print(int indent) const;
251 
252  Stmt *TypeCheck();
253  int EstimateCost() const;
254 
255  std::vector<Symbol *> dimVariables;
256  std::vector<Expr *> startExprs;
257  std::vector<Expr *> endExprs;
258  bool isTiled;
260 };
261 
262 /** Iteration over each executing program instance.
263  */
264 class ForeachActiveStmt : public Stmt {
265  public:
266  ForeachActiveStmt(Symbol *iterSym, Stmt *stmts, SourcePos pos);
267 
268  static inline bool classof(ForeachActiveStmt const *) { return true; }
269  static inline bool classof(ASTNode const *N) { return N->getValueID() == ForeachActiveStmtID; }
270 
271  void EmitCode(FunctionEmitContext *ctx) const;
272  void Print(int indent) const;
273 
274  Stmt *TypeCheck();
275  int EstimateCost() const;
276 
279 };
280 
281 /** Parallel iteration over each unique value in the given (varying)
282  expression.
283  */
284 class ForeachUniqueStmt : public Stmt {
285  public:
286  ForeachUniqueStmt(const char *iterName, Expr *expr, Stmt *stmts, SourcePos pos);
287 
288  static inline bool classof(ForeachUniqueStmt const *) { return true; }
289  static inline bool classof(ASTNode const *N) { return N->getValueID() == ForeachUniqueStmtID; }
290 
291  void EmitCode(FunctionEmitContext *ctx) const;
292  void Print(int indent) const;
293 
294  Stmt *TypeCheck();
295  int EstimateCost() const;
296 
300 };
301 
302 /**
303  */
304 class UnmaskedStmt : public Stmt {
305  public:
306  UnmaskedStmt(Stmt *stmt, SourcePos pos);
307 
308  static inline bool classof(UnmaskedStmt const *) { return true; }
309  static inline bool classof(ASTNode const *N) { return N->getValueID() == UnmaskedStmtID; }
310 
311  void EmitCode(FunctionEmitContext *ctx) const;
312  void Print(int indent) const;
313 
314  Stmt *TypeCheck();
315  int EstimateCost() const;
316 
318 };
319 
320 /** @brief Statement implementation for a 'return' statement in the
321  program. */
322 class ReturnStmt : public Stmt {
323  public:
324  ReturnStmt(Expr *e, SourcePos p);
325 
326  static inline bool classof(ReturnStmt const *) { return true; }
327  static inline bool classof(ASTNode const *N) { return N->getValueID() == ReturnStmtID; }
328 
329  void EmitCode(FunctionEmitContext *ctx) const;
330  void Print(int indent) const;
331 
332  Stmt *TypeCheck();
333  int EstimateCost() const;
334 
336 };
337 
338 /** Statement corresponding to a "case" label in the program. In addition
339  to the value associated with the "case", this statement also stores the
340  statements following it. */
341 class CaseStmt : public Stmt {
342  public:
343  CaseStmt(int value, Stmt *stmt, SourcePos pos);
344 
345  static inline bool classof(CaseStmt const *) { return true; }
346  static inline bool classof(ASTNode const *N) { return N->getValueID() == CaseStmtID; }
347 
348  void EmitCode(FunctionEmitContext *ctx) const;
349  void Print(int indent) const;
350 
351  Stmt *TypeCheck();
352  int EstimateCost() const;
353 
354  /** Integer value after the "case" statement */
355  const int value;
357 };
358 
359 /** Statement for a "default" label (as would be found inside a "switch"
360  statement). */
361 class DefaultStmt : public Stmt {
362  public:
363  DefaultStmt(Stmt *stmt, SourcePos pos);
364 
365  static inline bool classof(DefaultStmt const *) { return true; }
366  static inline bool classof(ASTNode const *N) { return N->getValueID() == DefaultStmtID; }
367 
368  void EmitCode(FunctionEmitContext *ctx) const;
369  void Print(int indent) const;
370 
371  Stmt *TypeCheck();
372  int EstimateCost() const;
373 
375 };
376 
377 /** A "switch" statement in the program. */
378 class SwitchStmt : public Stmt {
379  public:
380  SwitchStmt(Expr *expr, Stmt *stmts, SourcePos pos);
381 
382  static inline bool classof(SwitchStmt const *) { return true; }
383  static inline bool classof(ASTNode const *N) { return N->getValueID() == SwitchStmtID; }
384 
385  void EmitCode(FunctionEmitContext *ctx) const;
386  void Print(int indent) const;
387 
388  Stmt *TypeCheck();
389  int EstimateCost() const;
390 
391  /** Expression that is used to determine which label to jump to. */
393  /** Statement block after the "switch" expression. */
395 };
396 
397 /** A "goto" in an ispc program. */
398 class GotoStmt : public Stmt {
399  public:
400  GotoStmt(const char *label, SourcePos gotoPos, SourcePos idPos);
401 
402  static inline bool classof(GotoStmt const *) { return true; }
403  static inline bool classof(ASTNode const *N) { return N->getValueID() == GotoStmtID; }
404 
405  void EmitCode(FunctionEmitContext *ctx) const;
406  void Print(int indent) const;
407 
408  Stmt *Optimize();
409  Stmt *TypeCheck();
410  int EstimateCost() const;
411 
412  /** Name of the label to jump to when the goto is executed. */
413  std::string label;
415 };
416 
417 /** Statement corresponding to a label (as would be used as a goto target)
418  in the program. */
419 class LabeledStmt : public Stmt {
420  public:
421  LabeledStmt(const char *label, Stmt *stmt, SourcePos p);
422 
423  static inline bool classof(LabeledStmt const *) { return true; }
424  static inline bool classof(ASTNode const *N) { return N->getValueID() == LabeledStmtID; }
425 
426  void EmitCode(FunctionEmitContext *ctx) const;
427  void Print(int indent) const;
428 
429  Stmt *Optimize();
430  Stmt *TypeCheck();
431  int EstimateCost() const;
432 
433  /** Name of the label. */
434  std::string name;
435  /** Statements following the label. */
437 };
438 
439 /** @brief Representation of a list of statements in the program.
440  */
441 class StmtList : public Stmt {
442  public:
444 
445  static inline bool classof(StmtList const *) { return true; }
446  static inline bool classof(ASTNode const *N) { return N->getValueID() == StmtListID; }
447 
448  void EmitCode(FunctionEmitContext *ctx) const;
449  void Print(int indent) const;
450 
451  Stmt *TypeCheck();
452  int EstimateCost() const;
453 
454  void Add(Stmt *s) {
455  if (s)
456  stmts.push_back(s);
457  }
458 
459  std::vector<Stmt *> stmts;
460 };
461 
462 /** @brief Representation of a print() statement in the program.
463 
464  It's currently necessary to have a special statement type for print()
465  since strings aren't supported as first-class types in the language,
466  but we need to be able to pass a formatting string as the first
467  argument to print(). We also need this to be a variable argument
468  function, which also isn't supported. Representing print() as a
469  statement lets us work around both of those ugly little issues...
470  */
471 class PrintStmt : public Stmt {
472  public:
473  PrintStmt(const std::string &f, Expr *v, SourcePos p);
474 
475  static inline bool classof(PrintStmt const *) { return true; }
476  static inline bool classof(ASTNode const *N) { return N->getValueID() == PrintStmtID; }
477 
478  void EmitCode(FunctionEmitContext *ctx) const;
479  void Print(int indent) const;
480 
481  Stmt *TypeCheck();
482  int EstimateCost() const;
483 
484  /** Format string for the print() statement. */
485  const std::string format;
486  /** This holds the arguments passed to the print() statement. If more
487  than one was provided, this will be an ExprList. */
489 };
490 
491 /** @brief Representation of an assert statement in the program.
492 
493  Like print() above, since we don't have strings as first-class types in
494  the language, we need to do some gymnastics to support it. Like
495  assert() in C, assert() checks the given condition and prints an error
496  and calls abort if the condition fails. For varying conditions, the
497  assert triggers if it's true for any of the program instances.
498 */
499 class AssertStmt : public Stmt {
500  public:
501  AssertStmt(const std::string &msg, Expr *e, SourcePos p);
502 
503  static inline bool classof(AssertStmt const *) { return true; }
504  static inline bool classof(ASTNode const *N) { return N->getValueID() == AssertStmtID; }
505 
506  void EmitCode(FunctionEmitContext *ctx) const;
507  void Print(int indent) const;
508 
509  Stmt *TypeCheck();
510  int EstimateCost() const;
511 
512  /** Message to print if the assertion fails. */
513  const std::string message;
514  /** The expression to be evaluated (that is asserted to be true). */
516 };
517 
518 /** Representation of a delete statement in the program.
519  */
520 class DeleteStmt : public Stmt {
521  public:
522  DeleteStmt(Expr *e, SourcePos p);
523 
524  static inline bool classof(DeleteStmt const *) { return true; }
525  static inline bool classof(ASTNode const *N) { return N->getValueID() == DeleteStmtID; }
526 
527  void EmitCode(FunctionEmitContext *ctx) const;
528  void Print(int indent) const;
529 
530  Stmt *TypeCheck();
531  int EstimateCost() const;
532 
533  /** Expression that gives the pointer value to be deleted. */
535 };
536 
537 extern Stmt *CreateForeachActiveStmt(Symbol *iterSym, Stmt *stmts, SourcePos pos);
538 
539 #endif // ISPC_STMT_H
static bool classof(ASTNode const *N)
Definition: stmt.h:424
static bool classof(LabeledStmt const *)
Definition: stmt.h:423
Expr * expr
Definition: stmt.h:515
virtual int EstimateCost() const =0
static bool classof(ASTNode const *N)
Definition: stmt.h:106
Stmt * bodyStmts
Definition: stmt.h:173
std::vector< VariableDeclaration > vars
Definition: stmt.h:115
static bool classof(ASTNode const *N)
Definition: stmt.h:247
Stmt(SourcePos p, unsigned scid)
Definition: stmt.h:51
Stmt * stmts
Definition: stmt.h:356
const bool doCoherentCheck
Definition: stmt.h:204
static bool classof(ASTNode const *N)
Definition: stmt.h:309
static bool classof(ForeachStmt const *)
Definition: stmt.h:246
Stmt * trueStmts
Definition: stmt.h:138
Expr * expr
Definition: stmt.h:335
std::vector< Expr * > endExprs
Definition: stmt.h:257
static bool classof(ASTNode const *N)
Definition: stmt.h:164
static bool classof(ASTNode const *N)
Definition: stmt.h:346
Representation of a print() statement in the program.
Definition: stmt.h:471
static bool classof(AssertStmt const *)
Definition: stmt.h:503
Interface class for statements in the ispc language.
Definition: stmt.h:49
Statement representing a single declaration (which in turn may declare a number of variables...
Definition: stmt.h:101
static bool classof(ASTNode const *N)
Definition: stmt.h:54
static bool classof(ContinueStmt const *)
Definition: stmt.h:229
const std::string message
Definition: stmt.h:513
Statement representing a single expression.
Definition: stmt.h:74
const std::string format
Definition: stmt.h:485
static bool classof(ForStmt const *)
Definition: stmt.h:185
Stmt * CreateForeachActiveStmt(Symbol *iterSym, Stmt *stmts, SourcePos pos)
Definition: stmt.h:398
static bool classof(ASTNode const *N)
Definition: stmt.h:366
static bool classof(ASTNode const *N)
Definition: stmt.h:383
static bool classof(ASTNode const *N)
Definition: stmt.h:446
static bool classof(ExprStmt const *)
Definition: stmt.h:78
Statement implementation for &#39;for&#39; loops (as well as for &#39;while&#39; loops).
Definition: stmt.h:180
static bool classof(ASTNode const *N)
Definition: stmt.h:476
static bool classof(ASTNode const *N)
Definition: stmt.h:125
Representation of an assert statement in the program.
Definition: stmt.h:499
static bool classof(ForeachUniqueStmt const *)
Definition: stmt.h:288
Statement implementation representing a &#39;do&#39; statement in the program.
Definition: stmt.h:159
static bool classof(ASTNode const *N)
Definition: stmt.h:504
StmtList(SourcePos p)
Definition: stmt.h:443
Symbol * sym
Definition: stmt.h:95
const int value
Definition: stmt.h:355
virtual void EmitCode(FunctionEmitContext *ctx) const =0
static bool classof(StmtList const *)
Definition: stmt.h:445
static bool classof(Stmt const *)
Definition: stmt.h:53
Symbol * sym
Definition: stmt.h:297
static bool classof(UnmaskedStmt const *)
Definition: stmt.h:308
Expr * test
Definition: stmt.h:136
static bool classof(ASTNode const *N)
Definition: stmt.h:525
Stmt * stmts
Definition: stmt.h:394
static bool classof(GotoStmt const *)
Definition: stmt.h:402
Statement implementation for a break statement in the program.
Definition: stmt.h:209
Stmt * stmts
Definition: stmt.h:374
Expr * expr
Definition: stmt.h:392
Statement implementation for a &#39;return&#39; statement in the program.
Definition: stmt.h:322
static bool classof(SwitchStmt const *)
Definition: stmt.h:382
Expr * init
Definition: stmt.h:96
Abstract base class for nodes in the abstract syntax tree (AST).
Definition: ast.h:50
static bool classof(BreakStmt const *)
Definition: stmt.h:213
static bool classof(DefaultStmt const *)
Definition: stmt.h:365
virtual Stmt * TypeCheck()=0
unsigned getValueID() const
Definition: ast.h:134
Stmt * stmts
Definition: stmt.h:299
Stmt * step
Definition: stmt.h:201
Statement implementation for a continue statement in the program.
Definition: stmt.h:225
bool isTiled
Definition: stmt.h:258
static bool classof(ASTNode const *N)
Definition: stmt.h:230
VariableDeclaration(Symbol *s=NULL, Expr *i=NULL)
Definition: stmt.h:91
static bool classof(CaseStmt const *)
Definition: stmt.h:345
Representation of a range of positions in a source file.
Definition: ispc.h:131
Stmt * stmts
Definition: stmt.h:278
Stmt * stmts
Definition: stmt.h:203
static bool classof(ASTNode const *N)
Definition: stmt.h:289
SourcePos pos
Definition: ast.h:77
static bool classof(ASTNode const *N)
Definition: stmt.h:79
const bool doCoherentCheck
Definition: stmt.h:174
Expr * values
Definition: stmt.h:488
Expr * testExpr
Definition: stmt.h:172
Stmt * falseStmts
Definition: stmt.h:140
static bool classof(ReturnStmt const *)
Definition: stmt.h:326
static bool classof(ASTNode const *N)
Definition: stmt.h:327
Expr * test
Definition: stmt.h:198
Stmt * init
Definition: stmt.h:195
Stmt * stmts
Definition: stmt.h:259
Definition: stmt.h:341
static bool classof(ASTNode const *N)
Definition: stmt.h:186
std::vector< Expr * > startExprs
Definition: stmt.h:256
static bool classof(DoStmt const *)
Definition: stmt.h:163
Symbol * sym
Definition: stmt.h:277
SourcePos identifierPos
Definition: stmt.h:414
Representation of a program symbol.
Definition: sym.h:63
Stmt * stmt
Definition: stmt.h:436
std::vector< Stmt * > stmts
Definition: stmt.h:459
Expr * expr
Definition: stmt.h:87
Statement implementation for parallel &#39;foreach&#39; loops.
Definition: stmt.h:241
Stmt * stmts
Definition: stmt.h:317
static bool classof(DeclStmt const *)
Definition: stmt.h:105
Statement representing a single if statement, possibly with an else clause.
Definition: stmt.h:120
Expr is the abstract base class that defines the interface that all expression types must implement...
Definition: expr.h:48
Expr * expr
Definition: stmt.h:534
virtual Stmt * Optimize()
Definition: stmt.cpp:75
std::vector< Symbol * > dimVariables
Definition: stmt.h:255
Representation of a list of statements in the program.
Definition: stmt.h:441
static bool classof(DeleteStmt const *)
Definition: stmt.h:524
std::string name
Definition: stmt.h:434
virtual void Print(int indent) const =0
Expr * expr
Definition: stmt.h:298
static bool classof(ASTNode const *N)
Definition: stmt.h:214
std::string label
Definition: stmt.h:413
static bool classof(PrintStmt const *)
Definition: stmt.h:475
static bool classof(ASTNode const *N)
Definition: stmt.h:269
static bool classof(ASTNode const *N)
Definition: stmt.h:403
static bool classof(ForeachActiveStmt const *)
Definition: stmt.h:268
Main ispc.header file. Defines Target, Globals and Opt classes.
static bool classof(IfStmt const *)
Definition: stmt.h:124
const bool doAllCheck
Definition: stmt.h:147
void Add(Stmt *s)
Definition: stmt.h:454