[LLVM-C] Add bindings for addCoroutinePassesToExtensionPoints

Summary: This patch adds bindings to C and Go for addCoroutinePassesToExtensionPoints, which is used to add coroutine passes to the correct locations in PassManagerBuilder.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: mehdi_amini, modocache, llvm-commits

Differential Revision: https://reviews.llvm.org/D51642

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343336 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
whitequark 2018-09-28 16:38:11 +00:00
parent 6c702a8456
commit 411c9caf4f
3 changed files with 14 additions and 0 deletions

View File

@ -66,3 +66,7 @@ func (pmb PassManagerBuilder) SetDisableSimplifyLibCalls(val bool) {
func (pmb PassManagerBuilder) UseInlinerWithThreshold(threshold uint) {
C.LLVMPassManagerBuilderUseInlinerWithThreshold(pmb.C, C.uint(threshold))
}
func (pmb PassManagerBuilder) AddCoroutinePassesToExtensionPoints() {
C.LLVMPassManagerBuilderAddCoroutinePassesToExtensionPoints(pmb.C);
}

View File

@ -79,6 +79,9 @@ void LLVMPassManagerBuilderPopulateLTOPassManager(LLVMPassManagerBuilderRef PMB,
LLVMBool Internalize,
LLVMBool RunInliner);
/** See llvm::addCoroutinePassesToExtensionPoints. */
void LLVMPassManagerBuilderAddCoroutinePassesToExtensionPoints(LLVMPassManagerBuilderRef PMB);
/**
* @}
*/

View File

@ -30,6 +30,7 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h"
#include "llvm/Transforms/Coroutines.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/IPO/ForceFunctionAttrs.h"
#include "llvm/Transforms/IPO/FunctionAttrs.h"
@ -1068,3 +1069,9 @@ void LLVMPassManagerBuilderPopulateLTOPassManager(LLVMPassManagerBuilderRef PMB,
Builder->populateLTOPassManager(*LPM);
}
void
LLVMPassManagerBuilderAddCoroutinePassesToExtensionPoints(LLVMPassManagerBuilderRef PMB) {
PassManagerBuilder *Builder = unwrap(PMB);
addCoroutinePassesToExtensionPoints(*Builder);
}