mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Simplify code by using the right type.
Removes some comditional compiling by replacing unsigned with llvm::Attributes.
This commit is contained in:
@@ -13,11 +13,7 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if LDC_LLVM_VER == 300
|
||||
IrFuncTyArg::IrFuncTyArg(Type* t, bool bref, unsigned a) : type(t)
|
||||
#else
|
||||
IrFuncTyArg::IrFuncTyArg(Type* t, bool bref, llvm::Attributes a) : type(t)
|
||||
#endif
|
||||
{
|
||||
ltype = t != Type::tvoid && bref ? DtoType(t->pointerTo()) : DtoType(t);
|
||||
attrs = a;
|
||||
|
||||
@@ -3,9 +3,7 @@
|
||||
|
||||
#include "ir/ir.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#if LDC_LLVM_VER >= 301
|
||||
#include "llvm/Attributes.h"
|
||||
#endif
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -30,11 +28,7 @@ struct IrFuncTyArg : IrBase
|
||||
|
||||
/** These are the final LLVM attributes used for the function.
|
||||
* Must be valid for the LLVM Type and byref setting */
|
||||
#if LDC_LLVM_VER == 300
|
||||
unsigned attrs;
|
||||
#else
|
||||
llvm::Attributes attrs;
|
||||
#endif
|
||||
|
||||
/** 'true' if the final LLVM argument is a LLVM reference type.
|
||||
* Must be true when the D Type is a value type, but the final
|
||||
@@ -57,11 +51,7 @@ struct IrFuncTyArg : IrBase
|
||||
* @param byref Initial value for the 'byref' field. If true the initial
|
||||
* LLVM Type will be of DtoType(type->pointerTo()), instead
|
||||
* of just DtoType(type) */
|
||||
#if LDC_LLVM_VER == 300
|
||||
IrFuncTyArg(Type* t, bool byref, unsigned a = 0);
|
||||
#else
|
||||
IrFuncTyArg(Type* t, bool byref, llvm::Attributes a = llvm::Attribute::None);
|
||||
#endif
|
||||
};
|
||||
|
||||
// represents a function type
|
||||
|
||||
Reference in New Issue
Block a user