File tree Expand file tree Collapse file tree 5 files changed +24
-8
lines changed Expand file tree Collapse file tree 5 files changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ package llvm
14
14
15
15
/*
16
16
#include "llvm-c/Transforms/PassManagerBuilder.h"
17
+ #include "llvm-c/Transforms/Coroutines.h"
17
18
*/
18
19
import "C"
19
20
@@ -65,3 +66,7 @@ func (pmb PassManagerBuilder) SetDisableSimplifyLibCalls(val bool) {
65
66
func (pmb PassManagerBuilder ) UseInlinerWithThreshold (threshold uint ) {
66
67
C .LLVMPassManagerBuilderUseInlinerWithThreshold (pmb .C , C .uint (threshold ))
67
68
}
69
+
70
+ func (pmb PassManagerBuilder ) AddCoroutinePassesToExtensionPoints () {
71
+ C .LLVMPassManagerBuilderAddCoroutinePassesToExtensionPoints (pmb .C );
72
+ }
Original file line number Diff line number Diff line change 21
21
22
22
#include " llvm-c/ExternC.h"
23
23
#include " llvm-c/Types.h"
24
+ #include " llvm-c/Transforms/PassManagerBuilder.h"
24
25
25
26
LLVM_C_EXTERN_C_BEGIN
26
27
@@ -43,6 +44,9 @@ void LLVMAddCoroElidePass(LLVMPassManagerRef PM);
43
44
/* * See llvm::createCoroCleanupLegacyPass function. */
44
45
void LLVMAddCoroCleanupPass (LLVMPassManagerRef PM);
45
46
47
+ /* * See llvm::addCoroutinePassesToExtensionPoints. */
48
+ void LLVMPassManagerBuilderAddCoroutinePassesToExtensionPoints (LLVMPassManagerBuilderRef PMB);
49
+
46
50
/* *
47
51
* @}
48
52
*/
Original file line number Diff line number Diff line change 14
14
#ifndef LLVM_TRANSFORMS_IPO_PASSMANAGERBUILDER_H
15
15
#define LLVM_TRANSFORMS_IPO_PASSMANAGERBUILDER_H
16
16
17
+ #include " llvm-c/Transforms/PassManagerBuilder.h"
17
18
#include < functional>
18
19
#include < memory>
19
20
#include < string>
@@ -251,5 +252,13 @@ class RegisterStandardPasses {
251
252
}
252
253
};
253
254
255
+ inline PassManagerBuilder *unwrap (LLVMPassManagerBuilderRef P) {
256
+ return reinterpret_cast <PassManagerBuilder*>(P);
257
+ }
258
+
259
+ inline LLVMPassManagerBuilderRef wrap (PassManagerBuilder *P) {
260
+ return reinterpret_cast <LLVMPassManagerBuilderRef>(P);
261
+ }
262
+
254
263
} // end namespace llvm
255
264
#endif
Original file line number Diff line number Diff line change @@ -649,3 +649,9 @@ void LLVMAddCoroElidePass(LLVMPassManagerRef PM) {
649
649
void LLVMAddCoroCleanupPass (LLVMPassManagerRef PM) {
650
650
unwrap (PM)->add (createCoroCleanupLegacyPass ());
651
651
}
652
+
653
+ void
654
+ LLVMPassManagerBuilderAddCoroutinePassesToExtensionPoints (LLVMPassManagerBuilderRef PMB) {
655
+ PassManagerBuilder *Builder = unwrap (PMB);
656
+ addCoroutinePassesToExtensionPoints (*Builder);
657
+ }
Original file line number Diff line number Diff line change @@ -1125,14 +1125,6 @@ void PassManagerBuilder::populateLTOPassManager(legacy::PassManagerBase &PM) {
1125
1125
PM.add (createVerifierPass ());
1126
1126
}
1127
1127
1128
- inline PassManagerBuilder *unwrap (LLVMPassManagerBuilderRef P) {
1129
- return reinterpret_cast <PassManagerBuilder*>(P);
1130
- }
1131
-
1132
- inline LLVMPassManagerBuilderRef wrap (PassManagerBuilder *P) {
1133
- return reinterpret_cast <LLVMPassManagerBuilderRef>(P);
1134
- }
1135
-
1136
1128
LLVMPassManagerBuilderRef LLVMPassManagerBuilderCreate () {
1137
1129
PassManagerBuilder *PMB = new PassManagerBuilder ();
1138
1130
return wrap (PMB);
You can’t perform that action at this time.
0 commit comments