diff --git a/llvm/bindings/go/llvm/transforms_pmbuilder.go b/llvm/bindings/go/llvm/transforms_pmbuilder.go index b164e58812b1..3298f780f5a0 100644 --- a/llvm/bindings/go/llvm/transforms_pmbuilder.go +++ b/llvm/bindings/go/llvm/transforms_pmbuilder.go @@ -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); +} diff --git a/llvm/include/llvm-c/Transforms/PassManagerBuilder.h b/llvm/include/llvm-c/Transforms/PassManagerBuilder.h index 69786b341ab4..ff8f8729a6f1 100644 --- a/llvm/include/llvm-c/Transforms/PassManagerBuilder.h +++ b/llvm/include/llvm-c/Transforms/PassManagerBuilder.h @@ -79,6 +79,9 @@ void LLVMPassManagerBuilderPopulateLTOPassManager(LLVMPassManagerBuilderRef PMB, LLVMBool Internalize, LLVMBool RunInliner); +/** See llvm::addCoroutinePassesToExtensionPoints. */ +void LLVMPassManagerBuilderAddCoroutinePassesToExtensionPoints(LLVMPassManagerBuilderRef PMB); + /** * @} */ diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp index 62eb12c37a20..d6e86ad21539 100644 --- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp +++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp @@ -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); +}