view ir/irvar.h @ 700:716684a0d63f

Updated rebuild profile for .o output as default, compiler needs to be fixed still. Fixed segfault with ' ldc foo.o -offoo '.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Mon, 13 Oct 2008 18:19:43 +0200
parents eef8ac26c66c
children 340acf1535d0
line wrap: on
line source

#ifndef LDC_IR_IRVAR_H
#define LDC_IR_IRVAR_H

#include "ir/ir.h"
#include "llvm/Type.h"

struct IrVar : IrBase
{
    IrVar(VarDeclaration* var);

    VarDeclaration* V;
    llvm::Value* value;
};

// represents a global variable
struct IrGlobal : IrVar
{
    IrGlobal(VarDeclaration* v);

    llvm::PATypeHolder type;
    llvm::Constant* constInit;
};

// represents a local variable variable
struct IrLocal : IrVar
{
    IrLocal(VarDeclaration* v);

    int nestedIndex;
};

// represents an aggregate field variable
struct IrField : IrVar
{
    IrField(VarDeclaration* v);

    int index;
    size_t indexOffset;
    llvm::Constant* constInit;
};

#endif