From cb0201960ccb0008d12ddc8a38348029135524ac Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Wed, 17 Dec 2008 20:40:27 +0100 Subject: [PATCH] Apply wilsonk's patch to AddrExp::toConstElem for struct literals. --- gen/toir.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gen/toir.cpp b/gen/toir.cpp index dd581f0c..436c3842 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -988,6 +988,12 @@ LLConstant* AddrExp::toConstElem(IRState* p) assert(type->toBasetype()->ty == Tpointer); return DtoBitCast(gep, DtoType(type)); } + else if (e1->op == TOKstructliteral) + { + StructLiteralExp* slexp = (StructLiteralExp*)e1; + LLConstant* lit = slexp->toConstElem(p); + return lit; + } // not yet supported else {