From: Zoltan Varga Date: Mon, 20 Apr 2009 15:51:09 +0000 (-0000) Subject: 2009-04-20 Zoltan Varga X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=fc22ebaa26609c2b9d6c9b69e74aeda1c9d8db2f;p=mono.git 2009-04-20 Zoltan Varga * mini-llvm-cpp.cpp (mono_llvm_dump_value): New helper function to print a Value to stdout. * mini-llvm.c (mono_llvm_emit_method): Use it. svn path=/trunk/mono/; revision=132183 --- diff --git a/mono/mini/ChangeLog b/mono/mini/ChangeLog index 174663f6ec5..0af228a7976 100644 --- a/mono/mini/ChangeLog +++ b/mono/mini/ChangeLog @@ -1,5 +1,10 @@ 2009-04-20 Zoltan Varga + * mini-llvm-cpp.cpp (mono_llvm_dump_value): New helper function to print + a Value to stdout. + + * mini-llvm.c (mono_llvm_emit_method): Use it. + * mini-llvm.c (type_to_llvm_type): Fix the mapping of enums. (mono_llvm_emit_method): Add support for CAS. Fix handling of CSET opcodes on volatile values. diff --git a/mono/mini/mini-llvm-cpp.cpp b/mono/mini/mini-llvm-cpp.cpp index 237d853b06c..41708454eba 100644 --- a/mono/mini/mini-llvm-cpp.cpp +++ b/mono/mini/mini-llvm-cpp.cpp @@ -180,6 +180,13 @@ mono_llvm_optimize_method (LLVMValueRef method) fpm->run (*unwrap (method)); } +void +mono_llvm_dump_value (LLVMValueRef value) +{ + /* Same as LLVMDumpValue (), but print to stdout */ + cout << (*unwrap (value)); +} + /* Missing overload for building an alloca with an alignment */ LLVMValueRef mono_llvm_build_alloca (LLVMBuilderRef builder, LLVMTypeRef Ty, diff --git a/mono/mini/mini-llvm-cpp.h b/mono/mini/mini-llvm-cpp.h index 5080df23093..46c48990c06 100644 --- a/mono/mini/mini-llvm-cpp.h +++ b/mono/mini/mini-llvm-cpp.h @@ -27,6 +27,9 @@ mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, Func void mono_llvm_optimize_method (LLVMValueRef method); +void +mono_llvm_dump_value (LLVMValueRef value); + LLVMValueRef mono_llvm_build_alloca (LLVMBuilderRef builder, LLVMTypeRef Ty, LLVMValueRef ArraySize, diff --git a/mono/mini/mini-llvm.c b/mono/mini/mini-llvm.c index bbba39559d1..9798acb85ee 100644 --- a/mono/mini/mini-llvm.c +++ b/mono/mini/mini-llvm.c @@ -680,6 +680,11 @@ mono_llvm_emit_method (MonoCompile *cfg) method_type = sig_to_llvm_sig (ctx, sig, cfg->vret_addr != NULL); CHECK_FAILURE (ctx); + for (i = 0; i < sig->param_count; ++i) { + if (MONO_TYPE_ISSTRUCT (sig->params [i])) + LLVM_FAILURE (ctx, "vtype param"); + } + method_name = mono_method_full_name (cfg->method, TRUE); method = LLVMAddFunction (module, method_name, method_type); ctx->lmethod = method; @@ -1909,15 +1914,15 @@ mono_llvm_emit_method (MonoCompile *cfg) } if (last) - LLVMDumpValue (method); + mono_llvm_dump_value (method); if (cfg->verbose_level > 1) - LLVMDumpValue (method); + mono_llvm_dump_value (method); mono_llvm_optimize_method (method); if (cfg->verbose_level > 1) - LLVMDumpValue (method); + mono_llvm_dump_value (method); cfg->native_code = LLVMGetPointerToGlobal (ee, method);