mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-01 15:40:55 +03:00
Simplify code by using the right type.
Removes some comditional compiling by replacing unsigned with llvm::Attributes.
This commit is contained in:
parent
dbb5a34eda
commit
b53544b389
7 changed files with 1 additions and 57 deletions
|
@ -57,11 +57,8 @@ 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))
|
||||
{
|
||||
|
@ -77,13 +74,8 @@ 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);
|
||||
|
@ -157,11 +149,7 @@ 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)
|
||||
|
@ -424,11 +412,7 @@ 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);
|
||||
#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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue