source: icGREP/icgrep-devel/icgrep/pablo/pe_advance.h @ 5486

Last change on this file since 5486 was 5486, checked in by nmedfort, 2 years ago

Initial attempt to improve debugging capabilities with compilation stack traces on error.

File size: 1.1 KB
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_ADVANCE_H
8#define PE_ADVANCE_H
9
10#include <pablo/pabloAST.h>
11#include <pablo/pe_integer.h>
12
13namespace pablo {
14
15class Advance final : public CarryProducingStatement {
16    friend class PabloBlock;
17public:
18    static inline bool classof(const PabloAST * e) {
19        return e->getClassTypeId() == ClassTypeId::Advance;
20    }
21    static inline bool classof(const void *) {
22        return false;
23    }
24    virtual ~Advance() {
25    }
26    inline PabloAST * getExpression() const {
27        return getOperand(0);
28    }
29    inline int64_t getAmount() const {
30        return llvm::cast<Integer>(getOperand(1))->value();
31    }
32protected:
33    Advance(PabloAST * expr, PabloAST * shiftAmount, const String * name, Allocator & allocator)
34    : CarryProducingStatement(ClassTypeId::Advance, expr->getType(), {expr, shiftAmount}, name, allocator) {
35        assert(llvm::isa<Integer>(shiftAmount));
36    }
37};
38
39}
40
41#endif // PE_ADVANCE_H
42
43
44
Note: See TracBrowser for help on using the repository browser.