Mercurial > projects > dang
changeset 61:575c267bdd1f new_gen
New patch to LLVM D bindings from the llvmdc project - apply it in the root(where dsss.conf is)
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Tue, 29 Apr 2008 15:11:39 +0200 |
parents | 2451f0904bf6 |
children | 78a6808b2e0f |
files | llvm.patch |
diffstat | 1 files changed, 107 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/llvm.patch Tue Apr 29 15:11:39 2008 +0200 @@ -0,0 +1,107 @@ +Index: llvm/c/Core.d +=================================================================== +--- llvm/c/Core.d (revision 170) ++++ llvm/c/Core.d (working copy) +@@ -82,6 +82,20 @@ + */ + typedef LLVM_OpaqueMemoryBuffer* LLVMMemoryBufferRef; + ++enum LLVMParamAttr { ++ ZExt = 1<<0, ++ SExt = 1<<1, ++ NoReturn = 1<<2, ++ InReg = 1<<3, ++ StructRet = 1<<4, ++ NoUnwind = 1<<5, ++ NoAlias = 1<<6, ++ ByVal = 1<<7, ++ Nest = 1<<8, ++ ReadNone = 1<<9, ++ ReadOnly = 1<<10 ++} ++ + enum LLVMTypeKind { + Void, /**< type with no size */ + Float, /**< 32 bit floating point type */ +@@ -388,6 +402,14 @@ + /*const*/ char *LLVMGetCollector(LLVMValueRef Fn); + void LLVMSetCollector(LLVMValueRef Fn, /*const*/ char *Coll); + ++void LLVMAddParamAttr(LLVMValueRef Arg, LLVMParamAttr Attr); ++void LLVMRemoveParamAttr(LLVMValueRef Arg, LLVMParamAttr Attr); ++void LLVMSetParamAlignment(LLVMValueRef Arg, uint Align); ++void LLVMAddInstrParamAttr(LLVMValueRef Inst, uint Index, LLVMParamAttr Attr); ++void LLVMRemoveInstrParamAttr(LLVMValueRef Inst, uint Index, LLVMParamAttr Attr); ++void LLVMSetInstrParamAlignment(LLVMValueRef Inst, uint Index, uint Align); ++ ++ + /* Operations on basic blocks */ + LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef Bb); + int LLVMValueIsBasicBlock(LLVMValueRef Val); +Index: llvm/llvm.d +=================================================================== +--- llvm/llvm.d (revision 170) ++++ llvm/llvm.d (working copy) +@@ -43,6 +43,8 @@ + alias LLVMVisibility Visibility; + /// + alias LLVMValueKind ValueKind; ++/// ++public alias LLVMParamAttr ParamAttr; + + /// + class Module +@@ -836,6 +838,20 @@ + return getValueOf(v); + } + /// ++ void addParamAttr(uint idx, ParamAttr PA) ++ { ++ auto v = LLVMGetParam(value, idx); ++ assert(v !is null); ++ LLVMAddParamAttr(v, PA); ++ } ++ /// ++ void removeParamAttr(uint idx, ParamAttr PA) ++ { ++ auto v = LLVMGetParam(value, idx); ++ assert(v !is null); ++ LLVMRemoveParamAttr(v, PA); ++ } ++ /// + uint intrinsicID() + { + return LLVMGetIntrinsicID(value); +Index: llvm-fix.cpp +=================================================================== +--- llvm-fix.cpp (revision 170) ++++ llvm-fix.cpp (working copy) +@@ -29,10 +29,10 @@ + APN.convert(SemanticsForType(unwrap(RealTy)), APFloat::rmNearestTiesToEven); + return wrap(ConstantFP::get(unwrap(RealTy), APN)); + } +- ++/* + LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text) { + return wrap(ConstantFP::get(unwrap(RealTy), + APFloat(SemanticsForType(unwrap(RealTy)), Text))); + } +- ++*/ + } +Index: llvm-ext.cpp +=================================================================== +--- llvm-ext.cpp (revision 170) ++++ llvm-ext.cpp (working copy) +@@ -80,9 +80,11 @@ + LLVMTargetDataRef LLVMGetTargetDataFromModule(LLVMModuleRef M) { + return wrap(new TargetData(unwrap(M))); + } ++/* + void LLVMDisposeTargetData(LLVMTargetDataRef TD) { + delete unwrap(TD); + } ++*/ + + // we need to be able to query the ABI size of a type as an integer + size_t LLVMGetABITypeSize(LLVMTargetDataRef TD, LLVMTypeRef T) {