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/pablo/ps_assign.h

    r4199 r4200  
    1414
    1515class Assign : public PabloE {
     16    friend Assign * make_assign(const std::string, PabloE *);
    1617public:
    17     Assign(std::string m, PabloE* expr)
     18    static inline bool classof(const PabloE * e) {
     19        return e->getClassTypeId() == ClassTypeId::Assign;
     20    }
     21    static inline bool classof(const void *) {
     22        return false;
     23    }
     24    virtual ~Assign() {
     25        delete mExpr;
     26    }
     27
     28    inline const std::string & getM() const {
     29        return mM;
     30    }
     31
     32    inline PabloE * getExpr() const {
     33        return mExpr;
     34    }
     35protected:
     36    Assign(const std::string m, PabloE * expr)
    1837    : PabloE(ClassTypeId::Assign)
    1938    , mM(m)
     
    2241
    2342    }
     43private:
     44    const std::string   mM;
     45    PabloE * const      mExpr;
     46};
    2447
    25     virtual ~Assign() {
    26         delete mExpr;
    27     }
    28 
    29     inline std::string getM() const {
    30         return mM;
    31     }
    32 
    33     inline PabloE* getExpr() const {
    34         return mExpr;
    35     }
    36 private:
    37     std::string mM;
    38     PabloE* mExpr;
    39 };
     48inline Assign * make_assign(const std::string marker, PabloE * expr) {
     49    return new Assign(marker, expr);
     50}
    4051
    4152}
Note: See TracChangeset for help on using the changeset viewer.