Added pragma(llvmdc, "string") for misc per-module compiler configuration, currently "string" can only be "verbose" which forces -vv for module it appears in.

Reimplemented support for nested functions/class using a new approach.
Added error on taking address of intrinsic.
Fixed problems with the ->syntaxCopy of TypeFunction delegate exp.
Removed DtoDType and replaced all uses with ->toBasetype() instead.
Removed unused inplace stuff.
Fixed a bunch of issues in the runtime unittests, not complete yet.
Added mini tests.
This commit is contained in:
Tomas Lindquist Olsen
2008-08-10 08:37:38 +02:00
parent b2d860374b
commit 9d7f16b967
39 changed files with 693 additions and 455 deletions

View File

@@ -23,14 +23,14 @@
bool DtoIsPassedByRef(Type* type)
{
Type* typ = DtoDType(type);
Type* typ = type->toBasetype();
TY t = typ->ty;
return (t == Tstruct || t == Tarray || t == Tdelegate || t == Tsarray || typ->iscomplex());
}
bool DtoIsReturnedInArg(Type* type)
{
Type* typ = DtoDType(type);
Type* typ = type->toBasetype();
TY t = typ->ty;
return (t == Tstruct || t == Tarray || t == Tdelegate || t == Tsarray || typ->iscomplex());
}
@@ -54,16 +54,6 @@ unsigned DtoShouldExtend(Type* type)
return llvm::ParamAttr::None;
}
Type* DtoDType(Type* t)
{
if (t->ty == Ttypedef) {
Type* bt = t->toBasetype();
assert(bt);
return DtoDType(bt);
}
return t;
}
const LLType* DtoType(Type* t)
{
assert(t);
@@ -143,7 +133,7 @@ const LLType* DtoType(Type* t)
case Tfunction:
{
if (!t->ir.type || *t->ir.type == NULL) {
return DtoFunctionType(t,NULL);
return DtoFunctionType(t,NULL,NULL);
}
else {
return t->ir.type->get();
@@ -205,7 +195,7 @@ const LLType* DtoTypeNotVoid(Type* t)
const LLStructType* DtoDelegateType(Type* t)
{
const LLType* i8ptr = getVoidPtrType();
const LLType* func = DtoFunctionType(t->next, i8ptr);
const LLType* func = DtoFunctionType(t->next, NULL, i8ptr);
const LLType* funcptr = getPtrToType(func);
return LLStructType::get(i8ptr, funcptr, 0);
}
@@ -666,8 +656,9 @@ size_t getTypeStoreSize(const LLType* t)
size_t getABITypeSize(const LLType* t)
{
Logger::cout() << "getting abi type of: " << *t << '\n';
return gTargetData->getABITypeSize(t);
size_t sz = gTargetData->getABITypeSize(t);
Logger::cout() << "abi type size of: " << *t << " == " << sz << '\n';
return sz;
}
unsigned char getABITypeAlign(const LLType* t)