Mercurial > projects > ldc
view gen/dvalue.cpp @ 595:bbfb66c623e7
Fix output files being .d.bc. They're now .bc again.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 14 Sep 2008 19:51:38 +0200 |
parents | fbb1a366cfbc |
children | 03a5e609eef3 |
line wrap: on
line source
#include "gen/llvm.h" #include "gen/tollvm.h" #include "gen/irstate.h" #include "gen/logger.h" #include "gen/dvalue.h" #include "gen/llvmhelpers.h" #include "declaration.h" ///////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////// DVarValue::DVarValue(Type* t, VarDeclaration* vd, LLValue* llvmValue) { var = vd; val = llvmValue; type = t; } DVarValue::DVarValue(Type* t, LLValue* llvmValue) { var = 0; val = llvmValue; type = t; } LLValue* DVarValue::getLVal() { assert(val); return val; } LLValue* DVarValue::getRVal() { assert(val); Type* bt = type->toBasetype(); if (DtoIsPassedByRef(bt)) return val; return DtoLoad(val); } ///////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////// DFuncValue::DFuncValue(FuncDeclaration* fd, LLValue* v, LLValue* vt) { func = fd; type = func->type; val = v; vthis = vt; } LLValue* DFuncValue::getRVal() { assert(val); return val; } ///////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////// LLValue* DConstValue::getRVal() { assert(c); return c; } ///////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////