changeset 857:217e8c719a2f

Apply wilsonk's patch to AddrExp::toConstElem for struct literals.
author Christian Kamm <kamm incasoftware de>
date Wed, 17 Dec 2008 20:40:27 +0100
parents bdb3627265eb
children ebbbf8c3ce93
files gen/toir.cpp
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gen/toir.cpp	Wed Dec 17 18:20:45 2008 +0100
+++ b/gen/toir.cpp	Wed Dec 17 20:40:27 2008 +0100
@@ -988,6 +988,12 @@
         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
     {