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
RevLine 
[5202]1#ifndef STREAMTYPE_H
2#define STREAMTYPE_H
3
[5260]4#include <llvm/IR/Type.h>
5namespace IDISA { class IDISA_Builder; }
6namespace llvm { class LLVMContext; }
[5202]7
8namespace IDISA {
9
[5217]10class IDISA_Builder;
[5202]11
12class StreamType : public llvm::Type {
[5230]13    friend class IDISA_Builder;
[5202]14public:
15    enum {
16        StreamTyId = VectorTyID + 1
17    };
18
[5217]19    unsigned getFieldWidth() const {
20        return mFieldWidth;
21    }
22
23    llvm::Type * resolveType(IDISA_Builder * const iBuilder);
24
[5202]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    }
[5230]32protected:
33    StreamType(llvm::LLVMContext & ctx, unsigned FieldWidth)
34    : llvm::Type(ctx, (Type::TypeID)(StreamTyId))
35    , mFieldWidth(FieldWidth) {
36    }
[5202]37private:
[5217]38    unsigned mFieldWidth;
[5202]39};
40
41}
42
43#endif // STREAMTYPE_H
Note: See TracBrowser for help on using the repository browser.