mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-11-25 18:33:51 +01:00
Removed tango from the repository and instead added a runtime dir with the files needed to patch and build tango from svn.
Reworked the LLVMDC specific pragmas.
This commit is contained in:
+5
-4
@@ -2,9 +2,10 @@ enum
|
||||
{
|
||||
LLVMnone,
|
||||
LLVMintrinsic,
|
||||
LLVMva_arg,
|
||||
LLVMva_start,
|
||||
LLVMva_intrinsic,
|
||||
LLVMnotypeinfo,
|
||||
LLVMalloca
|
||||
LLVMno_typeinfo,
|
||||
LLVMno_moduleinfo,
|
||||
LLVMalloca,
|
||||
LLVMva_start,
|
||||
LLVMva_arg
|
||||
};
|
||||
|
||||
+3
-3
@@ -253,7 +253,7 @@ static llvm::Function* DtoDeclareVaFunction(FuncDeclaration* fdecl)
|
||||
assert(fn);
|
||||
}
|
||||
else if (fdecl->llvmInternal == LLVMva_intrinsic) {
|
||||
fn = gIR->module->getOrInsertFunction(fdecl->llvmInternal1, fty);
|
||||
fn = gIR->module->getOrInsertFunction(fdecl->intrinsicName, fty);
|
||||
assert(fn);
|
||||
}
|
||||
else
|
||||
@@ -405,9 +405,9 @@ void DtoDeclareFunction(FuncDeclaration* fdecl)
|
||||
}
|
||||
|
||||
// mangled name
|
||||
char* mangled_name;
|
||||
const char* mangled_name;
|
||||
if (fdecl->llvmInternal == LLVMintrinsic)
|
||||
mangled_name = fdecl->llvmInternal1;
|
||||
mangled_name = fdecl->intrinsicName.c_str();
|
||||
else
|
||||
mangled_name = fdecl->mangle();
|
||||
|
||||
|
||||
+1
-1
@@ -361,7 +361,7 @@ void DtoConstInitStruct(StructDeclaration* sd)
|
||||
gIR->structs.pop_back();
|
||||
|
||||
// emit typeinfo
|
||||
if (sd->getModule() == gIR->dmodule && sd->llvmInternal != LLVMnotypeinfo)
|
||||
if (sd->getModule() == gIR->dmodule && sd->llvmInternal != LLVMno_typeinfo)
|
||||
DtoTypeInfoOf(sd->type, false);
|
||||
}
|
||||
|
||||
|
||||
+5
-2
@@ -758,8 +758,11 @@ DValue* CallExp::toElem(IRState* p)
|
||||
FuncDeclaration* fndecl = dfnval->func;
|
||||
// va_start instruction
|
||||
if (fndecl->llvmInternal == LLVMva_start) {
|
||||
// TODO
|
||||
assert(0 && "va_start not yet implemented");
|
||||
// llvm doesn't need the second param hence the override
|
||||
Expression* exp = (Expression*)arguments->data[0];
|
||||
DValue* expv = exp->toElem(p);
|
||||
LLValue* arg = DtoBitCast(expv->getLVal(), getVoidPtrType());
|
||||
return new DImValue(type, gIR->ir->CreateCall(GET_INTRINSIC_DECL(vastart), arg, ""));
|
||||
}
|
||||
// va_arg instruction
|
||||
else if (fndecl->llvmInternal == LLVMva_arg) {
|
||||
|
||||
Reference in New Issue
Block a user