Mercurial > projects > ldc
comparison gen/irstate.h @ 31:2841234d2aea trunk
[svn r35] * Attributes on struct fields/methods now work
* Updated object.d to 1.021
* Added -novalidate command line option. this is sometimes useful when debugging as it may let you read the .ll even if it's invalid.
author | lindquist |
---|---|
date | Thu, 04 Oct 2007 16:44:07 +0200 |
parents | 37a4fdab33fc |
children | 8b0e809563df |
comparison
equal
deleted
inserted
replaced
30:881158a93592 | 31:2841234d2aea |
---|---|
39 // represents a struct or class | 39 // represents a struct or class |
40 struct IRStruct : Object | 40 struct IRStruct : Object |
41 { | 41 { |
42 typedef std::vector<const llvm::Type*> TypeVector; | 42 typedef std::vector<const llvm::Type*> TypeVector; |
43 typedef std::vector<llvm::Constant*> ConstantVector; | 43 typedef std::vector<llvm::Constant*> ConstantVector; |
44 typedef std::vector<llvm::PATypeHolder> PATypeHolderVector; | 44 typedef std::vector<FuncDeclaration*> FuncDeclVec; |
45 | 45 |
46 public: | 46 public: |
47 IRStruct(); | 47 IRStruct(); |
48 IRStruct(Type*); | 48 IRStruct(Type*); |
49 virtual ~IRStruct(); | 49 virtual ~IRStruct(); |
50 | 50 |
51 Type* type; | 51 Type* type; |
52 TypeVector fields; | 52 TypeVector fields; |
53 ConstantVector inits; | 53 ConstantVector inits; |
54 llvm::PATypeHolder recty; | 54 llvm::PATypeHolder recty; |
55 FuncDeclVec funcs; | |
56 bool queueFuncs; | |
55 }; | 57 }; |
56 | 58 |
57 // represents the module | 59 // represents the module |
58 struct IRState : Object | 60 struct IRState : Object |
59 { | 61 { |
76 IRStruct& topstruct(); | 78 IRStruct& topstruct(); |
77 | 79 |
78 // classes TODO move into IRClass | 80 // classes TODO move into IRClass |
79 typedef std::vector<ClassDeclaration*> ClassDeclVec; | 81 typedef std::vector<ClassDeclaration*> ClassDeclVec; |
80 ClassDeclVec classes; | 82 ClassDeclVec classes; |
81 | |
82 typedef std::vector<FuncDeclaration*> FuncDeclVec; | |
83 typedef std::vector<FuncDeclVec> ClassMethodVec; | |
84 ClassMethodVec classmethods; | |
85 | |
86 typedef std::vector<bool> BoolVec; | |
87 BoolVec queueClassMethods; | |
88 | 83 |
89 // D main function | 84 // D main function |
90 bool emitMain; | 85 bool emitMain; |
91 llvm::Function* mainFunc; | 86 llvm::Function* mainFunc; |
92 | 87 |
113 // VarDeclaration for __dollar, but I can't see how to get the | 108 // VarDeclaration for __dollar, but I can't see how to get the |
114 // array pointer from this :( | 109 // array pointer from this :( |
115 LvalVec arrays; | 110 LvalVec arrays; |
116 | 111 |
117 // keeping track of the declaration for the current function body | 112 // keeping track of the declaration for the current function body |
113 typedef std::vector<FuncDeclaration*> FuncDeclVec; | |
118 FuncDeclVec funcdecls; | 114 FuncDeclVec funcdecls; |
119 }; | 115 }; |
120 | 116 |
121 #endif // LLVMDC_GEN_IRSTATE_H | 117 #endif // LLVMDC_GEN_IRSTATE_H |