source: icGREP/icgrep-devel/icgrep/IR_Gen/types/streamtype.h @ 5260

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

Changes working towards simplifying accessing stream elements + some modifications to simplify include / forward declarations within the CodeGen? library.

File size: 961 bytes
Line 
1#ifndef STREAMTYPE_H
2#define STREAMTYPE_H
3
4#include <llvm/IR/Type.h>
5namespace IDISA { class IDISA_Builder; }
6namespace llvm { class LLVMContext; }
7
8namespace IDISA {
9
10class IDISA_Builder;
11
12class StreamType : public llvm::Type {
13    friend class IDISA_Builder;
14public:
15    enum {
16        StreamTyId = VectorTyID + 1
17    };
18
19    unsigned getFieldWidth() const {
20        return mFieldWidth;
21    }
22
23    llvm::Type * resolveType(IDISA_Builder * const iBuilder);
24
25    /// Methods for support type inquiry through isa, cast, and dyn_cast.
26    static inline bool classof(const llvm::Type * type) {
27        return type->getTypeID() == (Type::TypeID)(StreamTyId);
28    }
29    static inline bool classof(const void *) {
30        return false;
31    }
32protected:
33    StreamType(llvm::LLVMContext & ctx, unsigned FieldWidth)
34    : llvm::Type(ctx, (Type::TypeID)(StreamTyId))
35    , mFieldWidth(FieldWidth) {
36    }
37private:
38    unsigned mFieldWidth;
39};
40
41}
42
43#endif // STREAMTYPE_H
Note: See TracBrowser for help on using the repository browser.