OSDN Git Service

[LLVM-C] Add bindings for addCoroutinePassesToExtensionPoints
authorwhitequark <whitequark@whitequark.org>
Fri, 28 Sep 2018 16:38:11 +0000 (16:38 +0000)
committerwhitequark <whitequark@whitequark.org>
Fri, 28 Sep 2018 16:38:11 +0000 (16:38 +0000)
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

bindings/go/llvm/transforms_pmbuilder.go
include/llvm-c/Transforms/PassManagerBuilder.h
lib/Transforms/IPO/PassManagerBuilder.cpp

index b164e58..3298f78 100644 (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);
+}
index 69786b3..ff8f872 100644 (file)
@@ -79,6 +79,9 @@ void LLVMPassManagerBuilderPopulateLTOPassManager(LLVMPassManagerBuilderRef PMB,
                                                   LLVMBool Internalize,
                                                   LLVMBool RunInliner);
 
+/** See llvm::addCoroutinePassesToExtensionPoints. */
+void LLVMPassManagerBuilderAddCoroutinePassesToExtensionPoints(LLVMPassManagerBuilderRef PMB);
+
 /**
  * @}
  */
index 62eb12c..d6e86ad 100644 (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);
+}