mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Remove some redundancy from the DValue hierarchy: all subclasses had a 'type'
field and identical implementations of virtual function getType(). Move these to DValue itself, and make getType() non-virtual.
This commit is contained in:
@@ -12,18 +12,12 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DVarValue::DVarValue(Type* t, VarDeclaration* vd, LLValue* llvmValue)
|
||||
{
|
||||
var = vd;
|
||||
val = llvmValue;
|
||||
type = t;
|
||||
}
|
||||
: DValue(t), var(vd), val(llvmValue)
|
||||
{}
|
||||
|
||||
DVarValue::DVarValue(Type* t, LLValue* llvmValue)
|
||||
{
|
||||
var = 0;
|
||||
val = llvmValue;
|
||||
type = t;
|
||||
}
|
||||
: DValue(t), var(0), val(llvmValue)
|
||||
{}
|
||||
|
||||
LLValue* DVarValue::getLVal()
|
||||
{
|
||||
@@ -54,12 +48,8 @@ LLValue* DSliceValue::getRVal()
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DFuncValue::DFuncValue(FuncDeclaration* fd, LLValue* v, LLValue* vt)
|
||||
{
|
||||
func = fd;
|
||||
type = func->type;
|
||||
val = v;
|
||||
vthis = vt;
|
||||
}
|
||||
: DValue(fd->type), func(fd), val(v), vthis(vt)
|
||||
{}
|
||||
|
||||
LLValue* DFuncValue::getRVal()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user