source: icGREP/icgrep-devel/icgrep/pablo/pe_and.h @ 4200

Last change on this file since 4200 was 4200, checked in by nmedfort, 5 years ago

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

File size: 1018 bytes
Line 
1/*
2 *  Copyright (c) 2014 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
6
7#ifndef PE_AND_H
8#define PE_AND_H
9
10#include "pe_pabloe.h"
11
12namespace pablo {
13
14class And : public PabloE {
15    friend PabloE * make_and(PabloE *, PabloE *);
16public:
17    static inline bool classof(const PabloE * e) {
18        return e->getClassTypeId() == ClassTypeId::And;
19    }
20    static inline bool classof(const void *) {
21        return false;
22    }
23    virtual ~And() {
24        delete mExpr1;
25        delete mExpr2;
26    }
27    PabloE * getExpr1() const {
28        return mExpr1;
29    }
30    PabloE * getExpr2() const {
31        return mExpr2;
32    }
33protected:
34    And(PabloE * expr1, PabloE * expr2)
35    : PabloE(ClassTypeId::And)
36    , mExpr1(expr1)
37    , mExpr2(expr2)
38    {
39
40    }
41private:
42    PabloE * const mExpr1;
43    PabloE * const mExpr2;
44};
45
46PabloE * make_and(PabloE * expr1, PabloE * expr2);
47
48}
49
50#endif // PE_AND_H
51
52
Note: See TracBrowser for help on using the repository browser.