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

Last change on this file since 5229 was 5229, checked in by cameron, 2 years ago

Distinguishing between StreamType? and StreamSetType?; fixing StreamSetBlock? pointer calculations

File size: 974 bytes
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 FieldWidth);
14
15public:
16
17    enum {
18        StreamTyId = VectorTyID + 1
19    };
20
21    static StreamType * get(llvm::LLVMContext & ctx, unsigned FieldWidth);
22
23    unsigned getFieldWidth() const {
24        return mFieldWidth;
25    }
26
27    StreamType * getStreamElementType() const {
28        return get(getContext(), mFieldWidth);
29    }
30
31    llvm::Type * resolveType(IDISA_Builder * const iBuilder);
32
33    /// Methods for support type inquiry through isa, cast, and dyn_cast.
34    static inline bool classof(const llvm::Type * type) {
35        return type->getTypeID() == (Type::TypeID)(StreamTyId);
36    }
37    static inline bool classof(const void *) {
38        return false;
39    }
40private:
41    unsigned mFieldWidth;
42};
43
44}
45
46#endif // STREAMTYPE_H
Note: See TracBrowser for help on using the repository browser.