diff --git a/gen/dvalue.cpp b/gen/dvalue.cpp index c2f9b21a..1bd10e23 100644 --- a/gen/dvalue.cpp +++ b/gen/dvalue.cpp @@ -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; diff --git a/gen/toir.cpp b/gen/toir.cpp index 08ed1641..31d1162f 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -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(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; diff --git a/llvmdc.kdevelop.filelist b/llvmdc.kdevelop.filelist index 561246e8..8c9d71a4 100644 --- a/llvmdc.kdevelop.filelist +++ b/llvmdc.kdevelop.filelist @@ -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 diff --git a/tangotests/b.d b/tangotests/b.d index b5d6ee9e..916c267e 100644 --- a/tangotests/b.d +++ b/tangotests/b.d @@ -27,3 +27,8 @@ void access2(C c) { c.d = 2.5; } + +void main() +{ + func(); +} diff --git a/tangotests/c.d b/tangotests/c.d index ffc40ef8..f2e6b24f 100644 --- a/tangotests/c.d +++ b/tangotests/c.d @@ -18,3 +18,8 @@ void func2(Bar c) { c.i = 123; } + +void main() +{ + func(); +} \ No newline at end of file diff --git a/tangotests/d.d b/tangotests/compile/d.d similarity index 100% rename from tangotests/d.d rename to tangotests/compile/d.d diff --git a/tangotests/g.d b/tangotests/compile/g.d similarity index 100% rename from tangotests/g.d rename to tangotests/compile/g.d diff --git a/tangotests/e.d b/tangotests/e.d index f384a392..f3837e1f 100644 --- a/tangotests/e.d +++ b/tangotests/e.d @@ -20,3 +20,8 @@ void func() { scope c = new MyClass(42); } + +void main() +{ + func(); +} \ No newline at end of file diff --git a/tangotests/f.d b/tangotests/f.d index da0af5af..94e44af7 100644 --- a/tangotests/f.d +++ b/tangotests/f.d @@ -1,7 +1,5 @@ extern(C) int printf(char*,...); - - void main() { printf("Hello World!\n"); diff --git a/tangotests/p.d b/tangotests/fail/p.d similarity index 100% rename from tangotests/p.d rename to tangotests/fail/p.d diff --git a/tangotests/q.d b/tangotests/fail/q.d similarity index 100% rename from tangotests/q.d rename to tangotests/fail/q.d diff --git a/tangotests/h.d b/tangotests/h.d index 082f4588..805f5c88 100644 --- a/tangotests/h.d +++ b/tangotests/h.d @@ -21,7 +21,7 @@ class C : Iin } } -void func() +void main() { scope c = new C; } diff --git a/tangotests/i.d b/tangotests/i.d index caf77bd8..06b6d117 100644 --- a/tangotests/i.d +++ b/tangotests/i.d @@ -14,7 +14,7 @@ class C : AC } } -void func() +void main() { scope c = new C; }