X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fmini-llvm-cpp.cpp;h=a93ee9d9111282efa41f7bbf365408f93ad5f96b;hb=9e167696e7709b66bc42e7a822046665f7d29660;hp=e3219686ae2cf5beb7eb8ea5adb7fc9987e51d86;hpb=08a728d237965feb2bbd485f909998b17c0bbb11;p=mono.git diff --git a/mono/mini/mini-llvm-cpp.cpp b/mono/mini/mini-llvm-cpp.cpp index e3219686ae2..a93ee9d9111 100644 --- a/mono/mini/mini-llvm-cpp.cpp +++ b/mono/mini/mini-llvm-cpp.cpp @@ -54,10 +54,20 @@ mono_llvm_build_alloca (LLVMBuilderRef builder, LLVMTypeRef Ty, LLVMValueRef mono_llvm_build_load (LLVMBuilderRef builder, LLVMValueRef PointerVal, - const char *Name, gboolean is_volatile, BarrierKind barrier) + const char *Name, gboolean is_volatile) { LoadInst *ins = unwrap(builder)->CreateLoad(unwrap(PointerVal), is_volatile, Name); + return wrap(ins); +} + +LLVMValueRef +mono_llvm_build_atomic_load (LLVMBuilderRef builder, LLVMValueRef PointerVal, + const char *Name, gboolean is_volatile, int alignment, BarrierKind barrier) +{ + LoadInst *ins = unwrap(builder)->CreateLoad(unwrap(PointerVal), is_volatile, Name); + + ins->setAlignment (alignment); switch (barrier) { case LLVM_BARRIER_NONE: break; @@ -219,6 +229,14 @@ mono_llvm_set_call_preserveall_cc (LLVMValueRef func) unwrap(func)->setCallingConv (CallingConv::PreserveAll); } +void +mono_llvm_set_call_notail (LLVMValueRef func) +{ +#if LLVM_API_VERSION > 100 + unwrap(func)->setTailCallKind (CallInst::TailCallKind::TCK_NoTail); +#endif +} + #if LLVM_API_VERSION > 100 void* @@ -236,16 +254,21 @@ mono_llvm_di_create_compile_unit (void *di_builder, const char *cu_name, const c } void* -mono_llvm_di_create_function (void *di_builder, void *cu, const char *name, const char *mangled_name, const char *dir, const char *file, int line) +mono_llvm_di_create_function (void *di_builder, void *cu, LLVMValueRef func, const char *name, const char *mangled_name, const char *dir, const char *file, int line) { DIBuilder *builder = (DIBuilder*)di_builder; DIFile *di_file; DISubroutineType *type; + DISubprogram *di_func; // FIXME: Share DIFile di_file = builder->createFile (file, dir); type = builder->createSubroutineType (builder->getOrCreateTypeArray (ArrayRef ())); - return builder->createFunction (di_file, name, mangled_name, di_file, line, type, true, true, 0); + di_func = builder->createFunction (di_file, name, mangled_name, di_file, line, type, true, true, 0); + + unwrap(func)->setMetadata ("dbg", di_func); + + return di_func; } void*