[svn r136] MAJOR UNSTABLE UPDATE!!!

Initial commit after moving to Tango instead of Phobos.

Lots of bugfixes...

This build is not suitable for most things.
This commit is contained in:
Tomas Lindquist Olsen
2008-01-11 17:57:40 +01:00
parent bc08c6fcb1
commit b15b3484c8
524 changed files with 270705 additions and 175 deletions

View File

@@ -189,15 +189,17 @@ const llvm::FunctionType* DtoFunctionType(FuncDeclaration* fdecl)
const llvm::Type* thisty = NULL;
if (fdecl->needThis()) {
if (AggregateDeclaration* ad = fdecl->isMember()) {
Logger::print("isMember = this is: %s\n", ad->type->toChars());
if (AggregateDeclaration* ad = fdecl->isMember2()) {
Logger::println("isMember = this is: %s", ad->type->toChars());
thisty = DtoType(ad->type);
//Logger::cout() << "this llvm type: " << *thisty << '\n';
if (isaStruct(thisty) || (!gIR->structs.empty() && thisty == gIR->topstruct()->recty.get()))
thisty = llvm::PointerType::get(thisty);
}
else
assert(0);
else {
Logger::println("chars: %s type: %s kind: %s", fdecl->toChars(), fdecl->type->toChars(), fdecl->kind());
assert(0);
}
}
else if (fdecl->isNested()) {
thisty = llvm::PointerType::get(llvm::Type::Int8Ty);
@@ -245,7 +247,7 @@ void DtoResolveFunction(FuncDeclaration* fdecl)
if (fdecl->llvmResolved) return;
fdecl->llvmResolved = true;
Logger::println("DtoResolveFunction(%s)", fdecl->toPrettyChars());
Logger::println("DtoResolveFunction(%s): %s", fdecl->toPrettyChars(), fdecl->loc.toChars());
LOG_SCOPE;
if (fdecl->llvmRunTimeHack) {
@@ -289,7 +291,7 @@ void DtoDeclareFunction(FuncDeclaration* fdecl)
if (fdecl->llvmDeclared) return;
fdecl->llvmDeclared = true;
Logger::println("DtoDeclareFunction(%s)", fdecl->toPrettyChars());
Logger::println("DtoDeclareFunction(%s): %s", fdecl->toPrettyChars(), fdecl->loc.toChars());
LOG_SCOPE;
assert(!fdecl->isAbstract());
@@ -352,6 +354,17 @@ void DtoDeclareFunction(FuncDeclaration* fdecl)
if (!vafunc && fdecl->llvmInternal != LLVMintrinsic && fdecl->parent && DtoIsTemplateInstance(fdecl->parent))
func->setLinkage(llvm::GlobalValue::WeakLinkage);
// extern(C) functions are always external
if (f->linkage == LINKc)
func->setLinkage(llvm::GlobalValue::ExternalLinkage);
// intrinsics are always external C
if (fdecl->llvmInternal == LLVMintrinsic)
{
func->setLinkage(llvm::GlobalValue::ExternalLinkage);
func->setCallingConv(llvm::CallingConv::C);
}
fdecl->llvmValue = func;
assert(llvm::isa<llvm::FunctionType>(f->llvmType->get()));
@@ -427,7 +440,7 @@ void DtoDefineFunc(FuncDeclaration* fd)
assert(fd->llvmDeclared);
Logger::println("DtoDefineFunc(%s)", fd->toPrettyChars());
Logger::println("DtoDefineFunc(%s): %s", fd->toPrettyChars(), fd->loc.toChars());
LOG_SCOPE;
// debug info
@@ -495,7 +508,7 @@ void DtoDefineFunc(FuncDeclaration* fd)
vd->llvmValue = v;
}
else {
Logger::attention("some unknown argument: %s", arg ? arg->toChars() : 0);
Logger::attention(fd->loc, "some unknown argument: %s", arg ? arg->toChars() : 0);
}
}