mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
[LLVM-C] Add bindings for addCoroutinePassesToExtensionPoints
This patch adds bindings to C and Go for addCoroutinePassesToExtensionPoints, which is used to add coroutine passes to the correct locations in PassManagerBuilder. Differential Revision: https://reviews.llvm.org/D51642
This commit is contained in:
parent
f8f1dd101b
commit
00a4c69ae3
@ -14,6 +14,7 @@ package llvm
|
||||
|
||||
/*
|
||||
#include "llvm-c/Transforms/PassManagerBuilder.h"
|
||||
#include "llvm-c/Transforms/Coroutines.h"
|
||||
*/
|
||||
import "C"
|
||||
|
||||
@ -65,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);
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include "llvm-c/ExternC.h"
|
||||
#include "llvm-c/Types.h"
|
||||
#include "llvm-c/Transforms/PassManagerBuilder.h"
|
||||
|
||||
LLVM_C_EXTERN_C_BEGIN
|
||||
|
||||
@ -43,6 +44,9 @@ void LLVMAddCoroElidePass(LLVMPassManagerRef PM);
|
||||
/** See llvm::createCoroCleanupLegacyPass function. */
|
||||
void LLVMAddCoroCleanupPass(LLVMPassManagerRef PM);
|
||||
|
||||
/** See llvm::addCoroutinePassesToExtensionPoints. */
|
||||
void LLVMPassManagerBuilderAddCoroutinePassesToExtensionPoints(LLVMPassManagerBuilderRef PMB);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
@ -14,6 +14,7 @@
|
||||
#ifndef LLVM_TRANSFORMS_IPO_PASSMANAGERBUILDER_H
|
||||
#define LLVM_TRANSFORMS_IPO_PASSMANAGERBUILDER_H
|
||||
|
||||
#include "llvm-c/Transforms/PassManagerBuilder.h"
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
@ -251,5 +252,13 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
inline PassManagerBuilder *unwrap(LLVMPassManagerBuilderRef P) {
|
||||
return reinterpret_cast<PassManagerBuilder*>(P);
|
||||
}
|
||||
|
||||
inline LLVMPassManagerBuilderRef wrap(PassManagerBuilder *P) {
|
||||
return reinterpret_cast<LLVMPassManagerBuilderRef>(P);
|
||||
}
|
||||
|
||||
} // end namespace llvm
|
||||
#endif
|
||||
|
@ -649,3 +649,9 @@ void LLVMAddCoroElidePass(LLVMPassManagerRef PM) {
|
||||
void LLVMAddCoroCleanupPass(LLVMPassManagerRef PM) {
|
||||
unwrap(PM)->add(createCoroCleanupLegacyPass());
|
||||
}
|
||||
|
||||
void
|
||||
LLVMPassManagerBuilderAddCoroutinePassesToExtensionPoints(LLVMPassManagerBuilderRef PMB) {
|
||||
PassManagerBuilder *Builder = unwrap(PMB);
|
||||
addCoroutinePassesToExtensionPoints(*Builder);
|
||||
}
|
||||
|
@ -1125,14 +1125,6 @@ void PassManagerBuilder::populateLTOPassManager(legacy::PassManagerBase &PM) {
|
||||
PM.add(createVerifierPass());
|
||||
}
|
||||
|
||||
inline PassManagerBuilder *unwrap(LLVMPassManagerBuilderRef P) {
|
||||
return reinterpret_cast<PassManagerBuilder*>(P);
|
||||
}
|
||||
|
||||
inline LLVMPassManagerBuilderRef wrap(PassManagerBuilder *P) {
|
||||
return reinterpret_cast<LLVMPassManagerBuilderRef>(P);
|
||||
}
|
||||
|
||||
LLVMPassManagerBuilderRef LLVMPassManagerBuilderCreate() {
|
||||
PassManagerBuilder *PMB = new PassManagerBuilder();
|
||||
return wrap(PMB);
|
||||
|
Loading…
x
Reference in New Issue
Block a user