view gen/elem.h @ 11:d3ee9efe20e2 trunk

[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing. * Now 50/51 tests compile. * Added a simple runalltests.d scripts that should be run with 'gdmd -run runalltests.d' - LLVMDC will not compile it yet.
author lindquist
date Tue, 02 Oct 2007 05:10:18 +0200
parents c53b6e3fe49a
children 37a4fdab33fc
line wrap: on
line source

#ifndef LLVMDC_GEN_ELEM_H
#define LLVMDC_GEN_ELEM_H

#include "llvm/Value.h"

#include "root.h"
#include "declaration.h"
#include "aggregate.h"

// represents a value. be it a constant literal, a variable etc.
// maintains all the information for doing load/store appropriately
struct elem : Object
{
    enum {
        NONE,
        VAR,
        VAL,
        FUNC,
        CONST,
        NUL,
        REF,
        SLICE
    };

public:
    elem();

    llvm::Value* mem;
    llvm::Value* val;
    llvm::Value* arg;
    int type;
    bool inplace;
    bool field;
    unsigned callconv;

    VarDeclaration* vardecl;
    FuncDeclaration* funcdecl;

    llvm::Value* getValue();
    //llvm::Value* getMemory();

    bool isNull()   {return !(mem || val);}
};

#endif // LLVMDC_GEN_ELEM_H