[llvm] r222804 - Make sure that the go bindings call LLVMInitializeMCJITCompilerOptions

Peter Collingbourne peter at pcc.me.uk
Tue Nov 25 18:43:50 PST 2014


On Wed, Nov 26, 2014 at 02:27:46AM -0000, Eric Christopher wrote:
> +func SetMCJITOptimizationLevel(options MCJITCompilerOptions, level uint) {
> +	options.C.OptLevel = C.uint(level)
> +}

This function has no effect, as 'options' is passed by value.

This would be better as a method on the MCJITCompilerOptions type.
The signature should look like this in order to pass 'options' by reference:

func (options *MCJITCompilerOptions) SetOptLevel(level uint) { ... }

We should also have setters for the other properties.

Thanks,
-- 
Peter



More information about the llvm-commits mailing list