view llvm.patch @ 164:ba94fd563548

The symbol for the constructor a "new"-exp is calling is now stored in callSym in NewExp.
author Anders Johnsen <skabet@gmail.com>
date Tue, 22 Jul 2008 16:53:47 +0200
parents 575c267bdd1f
children cbebde9ba2c8
line wrap: on
line source

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) {