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

Last change on this file since 5297 was 5267, checked in by nmedfort, 3 years ago

Code clean-up. Removed Pablo Call, SetIthBit? and Prototype.

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