Ignore:
Timestamp:
Sep 30, 2014, 2:44:40 PM (5 years ago)
Author:
nmedfort
Message:

Replaced dynamic_cast with llvm::dyn_cast in pablo code; implemented make functions for pablo constructors. Disabled RTTI.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/llvm_gen_helper.cpp

    r4199 r4200  
    88
    99//Pablo Expressions
    10 #include "pe_pabloe.h"
    11 #include "pe_advance.h"
    12 #include "pe_and.h"
    13 #include "pe_charclass.h"
    14 #include "pe_not.h"
    15 #include "pe_or.h"
    16 #include "pe_matchstar.h"
    17 #include "pe_scanthru.h"
     10#include <pablo/pe_pabloe.h>
     11#include <pablo/pe_advance.h>
     12#include <pablo/pe_and.h>
     13#include <pablo/pe_charclass.h>
     14#include <pablo/pe_not.h>
     15#include <pablo/pe_or.h>
     16#include <pablo/pe_matchstar.h>
     17#include <pablo/pe_scanthru.h>
    1818
    1919//Pablo Statements
    20 #include "ps_pablos.h"
    21 #include "ps_assign.h"
    22 #include "ps_if.h"
    23 #include "ps_while.h"
     20#include <pablo/ps_pablos.h>
     21#include <pablo/ps_assign.h>
     22#include <pablo/ps_if.h>
     23#include <pablo/ps_while.h>
    2424
    2525using namespace pablo;
     
    4242    int retVal = 0;
    4343
    44     if (Assign* sm = dynamic_cast<Assign*>(stmt))
     44    if (Assign* sm = dyn_cast<Assign>(stmt))
    4545    {
    4646        retVal = CarryCount_PabloE(sm->getExpr());
    4747    }
    48     else if (If* ifstmt = dynamic_cast<If*>(stmt)) {
     48    else if (If* ifstmt = dyn_cast<If>(stmt)) {
    4949        retVal = CarryCount_PabloE(ifstmt->getExpr());
    5050        retVal += CarryCount_PabloStatements(ifstmt->getPSList());
     
    5454        if (retVal > 1) retVal++;
    5555    }
    56     else if (While* whl = dynamic_cast<While*>(stmt))
     56    else if (While* whl = dyn_cast<While>(stmt))
    5757    {
    5858        retVal = CarryCount_PabloE(whl->getExpr());
     
    6767    int retVal = 0;
    6868
    69     if (And* pablo_and = dynamic_cast<And*>(expr))
     69    if (And* pablo_and = dyn_cast<And>(expr))
    7070    {
    7171        retVal =  CarryCount_PabloE(pablo_and->getExpr1()) + CarryCount_PabloE(pablo_and->getExpr2());
    7272    }
    73     else if (Or* pablo_or = dynamic_cast<Or*>(expr))
     73    else if (Or* pablo_or = dyn_cast<Or>(expr))
    7474    {
    7575        retVal = CarryCount_PabloE(pablo_or->getExpr1()) + CarryCount_PabloE(pablo_or->getExpr2());
    7676    }
    77     else if (Not* pablo_not = dynamic_cast<Not*>(expr))
     77    else if (Not* pablo_not = dyn_cast<Not>(expr))
    7878    {
    7979        retVal = CarryCount_PabloE(pablo_not->getExpr());
    8080    }
    81     else if (Advance* adv = dynamic_cast<Advance*>(expr))
     81    else if (Advance* adv = dyn_cast<Advance>(expr))
    8282    {
    8383        //Carry queues are needed for advances.
    8484        retVal = 1 + CarryCount_PabloE(adv->getExpr());
    8585    }
    86     else if(MatchStar* mstar = dynamic_cast<MatchStar*>(expr))
     86    else if(MatchStar* mstar = dyn_cast<MatchStar>(expr))
    8787    {
    8888        //Carry queues are also needed for MatchStar.
    8989        retVal = 1 + CarryCount_PabloE(mstar->getExpr1()) + CarryCount_PabloE(mstar->getExpr2());
    9090    }
    91     else if (ScanThru* sthru = dynamic_cast<ScanThru*>(expr))
     91    else if (ScanThru* sthru = dyn_cast<ScanThru>(expr))
    9292    {
    9393        retVal = 1 + CarryCount_PabloE(sthru->getScanFrom()) + CarryCount_PabloE(sthru->getScanThru());
Note: See TracChangeset for help on using the changeset viewer.