Abstracted more (most) ABI details out of the normal codegen.

This commit is contained in:
Tomas Lindquist Olsen
2009-03-03 02:51:21 +01:00
parent 100815c097
commit 5dbe3ee8e2
11 changed files with 488 additions and 434 deletions

View File

@@ -2659,14 +2659,9 @@ TypeFunction::TypeFunction(Arguments *parameters, Type *treturn, int varargs, en
this->varargs = varargs;
this->linkage = linkage;
this->inuse = 0;
this->retInPtr = false;
this->usesThis = false;
this->usesNest = false;
this->structInregArg = NULL;
this->retAttrs = 0;
this->thisAttrs = 0;
this->reverseParams = false;
this->firstRealArg = 0;
// LDC
this->fty = NULL;
}
Type *TypeFunction::syntaxCopy()
@@ -2674,13 +2669,6 @@ Type *TypeFunction::syntaxCopy()
Type *treturn = next ? next->syntaxCopy() : NULL;
Arguments *params = Argument::arraySyntaxCopy(parameters);
TypeFunction *t = new TypeFunction(params, treturn, varargs, linkage);
t->retInPtr = retInPtr;
t->usesThis = usesThis;
t->usesNest = usesNest;
t->retAttrs = retAttrs;
t->thisAttrs = thisAttrs;
t->reverseParams = reverseParams;
t->firstRealArg = firstRealArg;
return t;
}
@@ -5316,7 +5304,6 @@ Argument::Argument(unsigned storageClass, Type *type, Identifier *ident, Express
this->ident = ident;
this->storageClass = storageClass;
this->defaultArg = defaultArg;
this->llvmAttrs = 0;
}
Argument *Argument::syntaxCopy()
@@ -5325,7 +5312,6 @@ Argument *Argument::syntaxCopy()
type ? type->syntaxCopy() : NULL,
ident,
defaultArg ? defaultArg->syntaxCopy() : NULL);
a->llvmAttrs = llvmAttrs;
return a;
}

View File

@@ -24,6 +24,7 @@
// llvm
#include "../ir/irtype.h"
namespace llvm { class Type; }
struct IrFuncTy;
struct Scope;
struct Identifier;
@@ -436,17 +437,7 @@ struct TypeFunction : Type
unsigned totym();
// LDC
bool retInPtr;
bool usesThis;
bool usesNest;
// when the last arg is a struct and passed in EAX, this holds its real type
const llvm::Type* structInregArg;
unsigned retAttrs;
unsigned thisAttrs; // also used for nest
// parameter index in the llvm function that contains the first not-implicit arg
size_t firstRealArg;
bool reverseParams;
IrFuncTy* fty;
};
struct TypeDelegate : Type
@@ -699,9 +690,6 @@ struct Argument : Object
static void argsToDecoBuffer(OutBuffer *buf, Arguments *arguments);
static size_t dim(Arguments *arguments);
static Argument *getNth(Arguments *arguments, size_t nth, size_t *pn = NULL);
// LDC
unsigned llvmAttrs;
};
extern int PTRSIZE;