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

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

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

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