Merged 1.075 frontend.

This commit is contained in:
David Nadlinger
2012-11-24 20:58:26 +01:00
parent 2d02270434
commit 288fd47707
49 changed files with 2306 additions and 2082 deletions

View File

@@ -1,5 +1,5 @@
// Copyright (c) 1999-2011 by Digital Mars
// Copyright (c) 1999-2012 by Digital Mars
// All Rights Reserved
// written by Walter Bright
// http://www.digitalmars.com
@@ -92,7 +92,9 @@ Expression *BinExp::arrayOp(Scope *sc)
{
//printf("BinExp::arrayOp() %s\n", toChars());
if (type->toBasetype()->nextOf()->toBasetype()->ty == Tvoid)
Type *tb = type->toBasetype();
assert(tb->ty == Tarray || tb->ty == Tsarray);
if (tb->nextOf()->toBasetype()->ty == Tvoid)
{
error("Cannot perform array operations on void[] arrays");
return new ErrorExp();
@@ -123,7 +125,10 @@ Expression *BinExp::arrayOp(Scope *sc)
buf.writestring(type->toBasetype()->nextOf()->toBasetype()->deco);
#endif
size_t namelen = buf.offset;
#if IN_LLVM
const size_t namelen = buf.offset;
#endif
buf.writeByte(0);
char *name = buf.toChars();
Identifier *ident = Lexer::idPool(name);
@@ -337,7 +342,7 @@ Expression *BinExp::arrayOp(Scope *sc)
// foreach (i; 0 .. p.length)
Statement *s1 = new ForeachRangeStatement(0, TOKforeach,
new Parameter(0, NULL, Id::p, NULL),
new IntegerExp(0, 0, Type::tint32),
new IntegerExp(0, 0, Type::tsize_t),
new ArrayLengthExp(0, new IdentifierExp(0, p->ident)),
new ExpStatement(0, loopbody));
#endif