source: icGREP/icgrep-devel/icgrep/pablo/pe_lookahead.h @ 5230

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

Multi-threading support for PabloAST / PabloCompiler?. Requires unique LLVM Context / Module for each thread.

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