[svn r188] Fixed using a dereferenced pointer argument as both l- and r-value. fixes tango.io.FileRoots.

Reorganized the tangotests dir a bit.
This commit is contained in:
Tomas Lindquist Olsen
2008-05-06 07:26:27 +02:00
parent d3b57eaf60
commit f716b18cc1
13 changed files with 23 additions and 17 deletions

View File

@@ -52,12 +52,8 @@ llvm::Value* DVarValue::getRVal()
}
else {
if (rval) return rval;
Logger::cout() << "val: " << *val << '\n';
if (isaArgument(val)) {
if (var && (var->isRef() || var->isOut()))
return DtoLoad(val);
}
else if (!isField() && DtoCanLoad(val)) {
//Logger::cout() << "val: " << *val << '\n';
if (!isThis() && !isField() && DtoCanLoad(val)) {
return DtoLoad(val);
}
return val;

View File

@@ -211,12 +211,6 @@ DValue* VarExp::toElem(IRState* p)
// function parameter
else if (vd->isParameter()) {
Logger::println("function param");
if (!gIR->irDsymbol[vd].getIrValue()) {
assert(0); // should be fixed now
// TODO: determine this properly
// this happens when the DMD frontend generates by pointer wrappers for struct opEquals(S) and opCmp(S)
gIR->irDsymbol[vd].getIrValue() = &p->func()->func->getArgumentList().back();
}
if (vd->isRef() || vd->isOut() || DtoIsPassedByRef(vd->type) || llvm::isa<llvm::AllocaInst>(gIR->irDsymbol[vd].getIrValue())) {
return new DVarValue(vd, gIR->irDsymbol[vd].getIrValue(), true);
}
@@ -1371,7 +1365,8 @@ DValue* DotVarExp::toElem(IRState* p)
Type* t = DtoDType(type);
Type* e1type = DtoDType(e1->type);
//Logger::print("e1type=%s\n", e1type->toChars());
//Logger::println("e1type=%s", e1type->toChars());
//Logger::cout() << *DtoType(e1type) << '\n';
if (VarDeclaration* vd = var->isVarDeclaration()) {
llvm::Value* arrptr;

View File

@@ -748,6 +748,8 @@ tango/tango/util/log/model/ILevel.d
tangotests
tangotests/a.d
tangotests/aa1.d
tangotests/abc.d
tangotests/abcd.d
tangotests/b.d
tangotests/c.d
tangotests/classes1.d

View File

@@ -27,3 +27,8 @@ void access2(C c)
{
c.d = 2.5;
}
void main()
{
func();
}

View File

@@ -18,3 +18,8 @@ void func2(Bar c)
{
c.i = 123;
}
void main()
{
func();
}

View File

@@ -20,3 +20,8 @@ void func()
{
scope c = new MyClass(42);
}
void main()
{
func();
}

View File

@@ -1,7 +1,5 @@
extern(C) int printf(char*,...);
void main()
{
printf("Hello World!\n");

View File

@@ -21,7 +21,7 @@ class C : Iin
}
}
void func()
void main()
{
scope c = new C;
}

View File

@@ -14,7 +14,7 @@ class C : AC
}
}
void func()
void main()
{
scope c = new C;
}