2009-04-20 Zoltan Varga <vargaz@gmail.com>
+ * 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.
fpm->run (*unwrap<Function> (method));
}
+void
+mono_llvm_dump_value (LLVMValueRef value)
+{
+ /* Same as LLVMDumpValue (), but print to stdout */
+ cout << (*unwrap<Value> (value));
+}
+
/* Missing overload for building an alloca with an alignment */
LLVMValueRef
mono_llvm_build_alloca (LLVMBuilderRef builder, LLVMTypeRef Ty,
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,
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;
}
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);