compiler/passes/normalize.cpp
// Constructs a PRIM_QUERY with arguments a, b
// Copies an expr argument but not a symbol argument
Constructs a PRIM_QUERY with arguments a, b
Copies an expr argument but not a symbol argument
Constructs a PRIM_QUERY with arguments a b Copies an expr argument but not a symbol argument
static CallExpr* makePrimQuery(BaseAST* a, BaseAST* b=NULL) {
  Expr* aExpr = NULL;
  Expr* bExpr = toExpr(b);
  if (Symbol* sym = toSymbol(a))
    aExpr = new SymExpr(sym);
  else if (Expr* expr = toExpr(a))
    aExpr = expr->copy();
  INT_ASSERT(aExpr);
  if (b) {
    if (Symbol* symB = toSymbol(b))
      bExpr = new SymExpr(symB);
    else if (Expr* expr = toExpr(b))
      bExpr = expr->copy();
    INT_ASSERT(bExpr);
  }
  if (bExpr == NULL)
    return new CallExpr(PRIM_QUERY, aExpr);
  else
    return new CallExpr(PRIM_QUERY, aExpr, bExpr);
}
static CallExpr * makePrimQuery ( BaseAST * a , BaseAST * b = NULL ) { Expr * aExpr = NULL ; Expr * bExpr = toExpr ( b ) ; if ( Symbol * sym = toSymbol ( a ) ) aExpr = new SymExpr ( sym ) ; else if ( Expr * expr = toExpr ( a ) ) aExpr = expr -> copy ( ) ; INT_ASSERT ( aExpr ) ; if ( b ) { if ( Symbol * symB = toSymbol ( b ) ) bExpr = new SymExpr ( symB ) ; else if ( Expr * expr = toExpr ( b ) ) bExpr = expr -> copy ( ) ; INT_ASSERT ( bExpr ) ; } if ( bExpr == NULL ) return new CallExpr ( PRIM_QUERY , aExpr ) ; else return new CallExpr ( PRIM_QUERY , aExpr , bExpr ) ; }
Constructs a PRIM_QUERY with arguments a, b
Copies an expr argument but not a symbol argument
Constructs a PRIM_QUERY with arguments a b Copies an expr argument but not a symbol argument