Mercurial > projects > ldc
changeset 836:14c3319ac1bb
This ''should'' fix #139 , I failed to produce a testcase, but I would imagine this to be correct, and it removes '''that''' error when building Hybrid.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Tue, 09 Dec 2008 03:01:19 +0100 |
parents | 3afe9f276db7 |
children | 331a176c1f4f |
files | gen/toir.cpp |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/gen/toir.cpp Tue Dec 09 02:07:24 2008 +0100 +++ b/gen/toir.cpp Tue Dec 09 03:01:19 2008 +0100 @@ -224,6 +224,13 @@ m = llvm::ConstantExpr::getBitCast(m, vartype); return m; } + else if (VarDeclaration* vd = var->isVarDeclaration()) + { + // return the initializer + assert(vd->init); + return DtoConstInitializer(loc, type, vd->init); + } + // fail assert(0 && "Unsupported const VarExp kind"); return NULL; }