Mercurial > projects > ldc
diff gen/toir.cpp @ 125:c42d245468ea trunk
[svn r129] Started AA literals.
Fixed #15, passing -O will now invoke the optimizer before writing bitcode.
author | lindquist |
---|---|
date | Wed, 28 Nov 2007 04:52:35 +0100 |
parents | a939ec89fc72 |
children | facc562f5674 |
line wrap: on
line diff
--- a/gen/toir.cpp Wed Nov 28 03:34:37 2007 +0100 +++ b/gen/toir.cpp Wed Nov 28 04:52:35 2007 +0100 @@ -2574,6 +2574,29 @@ ////////////////////////////////////////////////////////////////////////////////////////// +DValue* AssocArrayLiteralExp::toElem(IRState* p) +{ + Logger::print("AssocArrayLiteralExp::toElem: %s | %s\n", toChars(), type->toChars()); + LOG_SCOPE; + + assert(keys); + assert(values); + assert(keys->dim == values->dim); + + const size_t n = keys->dim; + for (size_t i=0; i<n; ++i) + { + Expression* ekey = (Expression*)keys->data[i]; + Expression* eval = (Expression*)values->data[i]; + + Logger::println("(%u) aa[%s] = %s", i, ekey->toChars(), eval->toChars()); + } + + assert(0); +} + +////////////////////////////////////////////////////////////////////////////////////////// + #define STUB(x) DValue *x::toElem(IRState * p) {error("Exp type "#x" not implemented: %s", toChars()); fatal(); return 0; } //STUB(IdentityExp); //STUB(CondExp); @@ -2645,7 +2668,7 @@ //STUB(HaltExp); STUB(RemoveExp); //STUB(ArrayLiteralExp); -STUB(AssocArrayLiteralExp); +//STUB(AssocArrayLiteralExp); //STUB(StructLiteralExp); STUB(TupleExp);