mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-18 05:43:14 +01:00
Use caching in DtoVaFunctionType.
Remove now unused method IrFuncTy.reset().
This commit is contained in:
@@ -377,25 +377,23 @@ LLFunction* DtoInlineIRFunction(FuncDeclaration* fdecl)
|
||||
static llvm::FunctionType* DtoVaFunctionType(FuncDeclaration* fdecl)
|
||||
{
|
||||
IrFuncTy &irFty = fdecl->irFty;
|
||||
LLFunctionType* type = 0;
|
||||
if (irFty.funcType) return irFty.funcType;
|
||||
|
||||
// create new ir funcTy
|
||||
irFty.reset();
|
||||
irFty.ret = new IrFuncTyArg(Type::tvoid, false);
|
||||
|
||||
irFty.args.push_back(new IrFuncTyArg(Type::tvoid->pointerTo(), false));
|
||||
|
||||
if (fdecl->llvmInternal == LLVMva_start)
|
||||
type = GET_INTRINSIC_DECL(vastart)->getFunctionType();
|
||||
irFty.funcType = GET_INTRINSIC_DECL(vastart)->getFunctionType();
|
||||
else if (fdecl->llvmInternal == LLVMva_copy) {
|
||||
type = GET_INTRINSIC_DECL(vacopy)->getFunctionType();
|
||||
irFty.funcType = GET_INTRINSIC_DECL(vacopy)->getFunctionType();
|
||||
irFty.args.push_back(new IrFuncTyArg(Type::tvoid->pointerTo(), false));
|
||||
}
|
||||
else if (fdecl->llvmInternal == LLVMva_end)
|
||||
type = GET_INTRINSIC_DECL(vaend)->getFunctionType();
|
||||
assert(type);
|
||||
irFty.funcType = GET_INTRINSIC_DECL(vaend)->getFunctionType();
|
||||
assert(irFty.funcType);
|
||||
|
||||
return type;
|
||||
return irFty.funcType;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -159,19 +159,6 @@ struct IrFuncTy
|
||||
}
|
||||
#endif
|
||||
|
||||
void reset() {
|
||||
funcType = 0;
|
||||
ret = NULL;
|
||||
arg_sret = arg_this = arg_nest = arg_arguments = arg_argptr = NULL;
|
||||
#if defined(_MSC_VER)
|
||||
args = IrFuncTy::ArgList();
|
||||
#else
|
||||
args.clear();
|
||||
#endif
|
||||
c_vararg = false;
|
||||
reverseParams = false;
|
||||
}
|
||||
|
||||
llvm::Value* putRet(Type* dty, DValue* dval);
|
||||
llvm::Value* getRet(Type* dty, DValue* dval);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user