mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-18 01:39:03 +02:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user