Reduce include-order dependencies

This commit is contained in:
Frits van Bommel 2009-04-12 12:52:01 +02:00
parent 35a3d86cc6
commit 605593bcef
2 changed files with 24 additions and 24 deletions

View file

@ -38,8 +38,8 @@ struct DValue : Object
Type*& getType() { assert(type); return type; } Type*& getType() { assert(type); return type; }
virtual LLValue* getLVal() { assert(0); return 0; } virtual llvm::Value* getLVal() { assert(0); return 0; }
virtual LLValue* getRVal() { assert(0); return 0; } virtual llvm::Value* getRVal() { assert(0); return 0; }
virtual bool isLVal() { return false; } virtual bool isLVal() { return false; }
@ -60,11 +60,11 @@ protected:
// immediate d-value // immediate d-value
struct DImValue : DValue struct DImValue : DValue
{ {
LLValue* val; llvm::Value* val;
DImValue(Type* t, LLValue* v) : DValue(t), val(v) { } DImValue(Type* t, llvm::Value* v) : DValue(t), val(v) { }
virtual LLValue* getRVal() { assert(val); return val; } virtual llvm::Value* getRVal() { assert(val); return val; }
virtual DImValue* isIm() { return this; } virtual DImValue* isIm() { return this; }
}; };
@ -72,11 +72,11 @@ struct DImValue : DValue
// constant d-value // constant d-value
struct DConstValue : DValue struct DConstValue : DValue
{ {
LLConstant* c; llvm::Constant* c;
DConstValue(Type* t, LLConstant* con) : DValue(t), c(con) {} DConstValue(Type* t, llvm::Constant* con) : DValue(t), c(con) {}
virtual LLValue* getRVal(); virtual llvm::Value* getRVal();
virtual DConstValue* isConst() { return this; } virtual DConstValue* isConst() { return this; }
}; };
@ -84,7 +84,7 @@ struct DConstValue : DValue
// null d-value // null d-value
struct DNullValue : DConstValue struct DNullValue : DConstValue
{ {
DNullValue(Type* t, LLConstant* con) : DConstValue(t,con) {} DNullValue(Type* t, llvm::Constant* con) : DConstValue(t,con) {}
virtual DNullValue* isNull() { return this; } virtual DNullValue* isNull() { return this; }
}; };
@ -92,14 +92,14 @@ struct DNullValue : DConstValue
struct DVarValue : DValue struct DVarValue : DValue
{ {
VarDeclaration* var; VarDeclaration* var;
LLValue* val; llvm::Value* val;
DVarValue(Type* t, VarDeclaration* vd, LLValue* llvmValue); DVarValue(Type* t, VarDeclaration* vd, llvm::Value* llvmValue);
DVarValue(Type* t, LLValue* llvmValue); DVarValue(Type* t, llvm::Value* llvmValue);
virtual bool isLVal() { return true; } virtual bool isLVal() { return true; }
virtual LLValue* getLVal(); virtual llvm::Value* getLVal();
virtual LLValue* getRVal(); virtual llvm::Value* getRVal();
virtual DVarValue* isVar() { return this; } virtual DVarValue* isVar() { return this; }
}; };
@ -107,19 +107,19 @@ struct DVarValue : DValue
// field d-value // field d-value
struct DFieldValue : DVarValue struct DFieldValue : DVarValue
{ {
DFieldValue(Type* t, LLValue* llvmValue) : DVarValue(t, llvmValue) {} DFieldValue(Type* t, llvm::Value* llvmValue) : DVarValue(t, llvmValue) {}
virtual DFieldValue* isField() { return this; } virtual DFieldValue* isField() { return this; }
}; };
// slice d-value // slice d-value
struct DSliceValue : DValue struct DSliceValue : DValue
{ {
LLValue* len; llvm::Value* len;
LLValue* ptr; llvm::Value* ptr;
DSliceValue(Type* t, LLValue* l, LLValue* p) : DValue(t), len(l), ptr(p) {} DSliceValue(Type* t, llvm::Value* l, llvm::Value* p) : DValue(t), len(l), ptr(p) {}
virtual LLValue* getRVal(); virtual llvm::Value* getRVal();
virtual DSliceValue* isSlice() { return this; } virtual DSliceValue* isSlice() { return this; }
}; };
@ -128,12 +128,12 @@ struct DSliceValue : DValue
struct DFuncValue : DValue struct DFuncValue : DValue
{ {
FuncDeclaration* func; FuncDeclaration* func;
LLValue* val; llvm::Value* val;
LLValue* vthis; llvm::Value* vthis;
DFuncValue(FuncDeclaration* fd, LLValue* v, LLValue* vt = 0); DFuncValue(FuncDeclaration* fd, llvm::Value* v, llvm::Value* vt = 0);
virtual LLValue* getRVal(); virtual llvm::Value* getRVal();
virtual DFuncValue* isFunc() { return this; } virtual DFuncValue* isFunc() { return this; }
}; };

View file

@ -1,3 +1,4 @@
#include "gen/llvmhelpers.h"
#include "gen/llvm.h" #include "gen/llvm.h"
#include "llvm/Target/TargetMachineRegistry.h" #include "llvm/Target/TargetMachineRegistry.h"
@ -9,7 +10,6 @@
#include "module.h" #include "module.h"
#include "gen/tollvm.h" #include "gen/tollvm.h"
#include "gen/llvmhelpers.h"
#include "gen/irstate.h" #include "gen/irstate.h"
#include "gen/runtime.h" #include "gen/runtime.h"
#include "gen/logger.h" #include "gen/logger.h"