Start unification of master and llvm-3.1 branch.

This commit is contained in:
kai
2012-07-29 13:26:25 +02:00
parent 2addbd2b71
commit 9bf65bc9a2
3 changed files with 40 additions and 1 deletions

View File

@@ -57,7 +57,11 @@ llvm::FunctionType* DtoFunctionType(Type* type, Type* thistype, Type* nesttype,
else
{
Type* rt = f->next;
#if LDC_LLVM_VER == 300
unsigned a = 0;
#else
llvm::Attributes a = None;
#endif
// sret return
if (abi->returnInArg(f))
{
@@ -73,8 +77,13 @@ llvm::FunctionType* DtoFunctionType(Type* type, Type* thistype, Type* nesttype,
if (f->isref)
t = t->pointerTo();
#endif
#if LDC_LLVM_VER == 300
if (unsigned se = DtoShouldExtend(t))
a = se;
#else
if (llvm::Attributes atts = DtoShouldExtend(t))
a = atts;
#endif
}
#if DMDV2
fty.ret = new IrFuncTyArg(rt, f->isref, a);
@@ -148,7 +157,11 @@ llvm::FunctionType* DtoFunctionType(Type* type, Type* thistype, Type* nesttype,
#endif
Type* argtype = arg->type;
#if LDC_LLVM_VER == 300
unsigned a = 0;
#else
llvm::Attributes a = None;
#endif
// handle lazy args
if (arg->storageClass & STClazy)
@@ -411,7 +424,11 @@ static void set_param_attrs(TypeFunction* f, llvm::Function* func, FuncDeclarati
// set attrs on the rest of the arguments
size_t n = Parameter::dim(f->parameters);
LLSmallVector<unsigned,8> attrptr(n, 0);
#if LDC_LLVM_VER == 300
LLSmallVector<unsigned, 8> attrptr(n, 0);
#else
LLSmallVector<llvm::Attributes, 8> attrptr(n, None);
#endif
for (size_t k = 0; k < n; ++k)
{