source: icGREP/icgrep-devel/icgrep/IDISA/types/streamtype.h @ 5217

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

Merged PabloFunction? and PabloKernel? classes. Updated projects where necessary.

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