From a256889fb23353935e75c9c228883d4ca1b03c45 Mon Sep 17 00:00:00 2001 From: Andrew Wilkins Date: Fri, 17 Feb 2017 05:41:05 +0000 Subject: [PATCH] Go binding: Add methods for missing PassManagerBuilder C APIs Patch by Ryuichi Hayashida! Differential Revision: http://reviews.llvm.org/D30042 llvm-svn: 295420 --- llvm/bindings/go/llvm/transforms_pmbuilder.go | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/llvm/bindings/go/llvm/transforms_pmbuilder.go b/llvm/bindings/go/llvm/transforms_pmbuilder.go index 3d79d6e2f327..b164e58812b1 100644 --- a/llvm/bindings/go/llvm/transforms_pmbuilder.go +++ b/llvm/bindings/go/llvm/transforms_pmbuilder.go @@ -43,6 +43,26 @@ func (pmb PassManagerBuilder) PopulateFunc(pm PassManager) { C.LLVMPassManagerBuilderPopulateFunctionPassManager(pmb.C, pm.C) } +func (pmb PassManagerBuilder) PopulateLTOPassManager(pm PassManager, internalize bool, runInliner bool) { + C.LLVMPassManagerBuilderPopulateLTOPassManager(pmb.C, pm.C, boolToLLVMBool(internalize), boolToLLVMBool(runInliner)) +} + func (pmb PassManagerBuilder) Dispose() { C.LLVMPassManagerBuilderDispose(pmb.C) } + +func (pmb PassManagerBuilder) SetDisableUnitAtATime(val bool) { + C.LLVMPassManagerBuilderSetDisableUnitAtATime(pmb.C, boolToLLVMBool(val)) +} + +func (pmb PassManagerBuilder) SetDisableUnrollLoops(val bool) { + C.LLVMPassManagerBuilderSetDisableUnrollLoops(pmb.C, boolToLLVMBool(val)) +} + +func (pmb PassManagerBuilder) SetDisableSimplifyLibCalls(val bool) { + C.LLVMPassManagerBuilderSetDisableSimplifyLibCalls(pmb.C, boolToLLVMBool(val)) +} + +func (pmb PassManagerBuilder) UseInlinerWithThreshold(threshold uint) { + C.LLVMPassManagerBuilderUseInlinerWithThreshold(pmb.C, C.uint(threshold)) +}