mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Added -version=Tango in default llvmdc.conf
Fixed problem with array casts, all DWT modules needed for HelloWorld1 samples now compile. Still some linking issues.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
|
||||
[Environment]
|
||||
|
||||
DFLAGS=-I%@P%/../tango -I%@P%/../tango/lib/common -L-L%@P%/../lib
|
||||
DFLAGS=-I%@P%/../tango -I%@P%/../tango/lib/common -L-L%@P%/../lib -version=Tango
|
||||
|
||||
@@ -998,10 +998,12 @@ DValue* DtoCastArray(Loc& loc, DValue* u, Type* to)
|
||||
rval2 = DtoArrayCastLength(DtoArrayLen(usl), ety, ptrty->getContainedType(0));
|
||||
}
|
||||
else {
|
||||
LLValue* uval = u->getRVal();
|
||||
if (fromtype->ty == Tsarray) {
|
||||
LLValue* uval = u->getRVal();
|
||||
|
||||
if (Logger::enabled())
|
||||
Logger::cout() << "uvalTy = " << *uval->getType() << '\n';
|
||||
|
||||
assert(isaPointer(uval->getType()));
|
||||
const LLArrayType* arrty = isaArray(uval->getType()->getContainedType(0));
|
||||
|
||||
@@ -1016,15 +1018,10 @@ DValue* DtoCastArray(Loc& loc, DValue* u, Type* to)
|
||||
rval = DtoBitCast(uval, ptrty);
|
||||
}
|
||||
else {
|
||||
LLValue* zero = llvm::ConstantInt::get(LLType::Int32Ty, 0, false);
|
||||
LLValue* one = llvm::ConstantInt::get(LLType::Int32Ty, 1, false);
|
||||
rval2 = DtoGEP(uval,zero,zero);
|
||||
rval2 = DtoLoad(rval2);
|
||||
rval2 = DtoArrayLen(u);
|
||||
rval2 = DtoArrayCastLength(rval2, ety, ptrty->getContainedType(0));
|
||||
|
||||
rval = DtoGEP(uval,zero,one);
|
||||
rval = DtoLoad(rval);
|
||||
//Logger::cout() << *e->mem->getType() << '|' << *ptrty << '\n';
|
||||
rval = DtoArrayPtr(u);
|
||||
rval = DtoBitCast(rval, ptrty);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ testversion=LLVM64
|
||||
|
||||
|
||||
[compile]
|
||||
cmd=llvmdc -version=Tango -c $i
|
||||
cmd=llvmdc -c $i
|
||||
|
||||
flag=$i
|
||||
incdir=-I$i
|
||||
|
||||
Reference in New Issue
Block a user