Skip to content

Remove bindings for LLVM's legacy optimization passes #911

Open
@MaskRay

Description

@MaskRay

Related to #5

In LLVM, "Using the legacy pass manager for the optimization pipeline is deprecated" since 13.0.0 (
https://releases.llvm.org/13.0.0/docs/ReleaseNotes.html#changes-to-the-llvm-ir). Many passes have been removed or are being removed for 16.0 and 17.0.

A lot of wrappers in ffi/passmanagers.cpp should be removed since the wrapped C ABIs have been removed by https://github.com/llvm/llvm-project . I am not familiar with the project but from a glance the two files need most changes.

These lines in ffi/initfini.cpp will be broken by https://reviews.llvm.org/D145043

 INIT(Core)
 ...

ffi/passmanagers.cpp

 API_EXPORT(int)
@@ -143,60 +124,9 @@
 }

 API_EXPORT(void)
-LLVMPY_AddAAEvalPass(LLVMPassManagerRef PM) {
-    unwrap(PM)->add(llvm::createAAEvalPass());
-}
-
-API_EXPORT(void)
-LLVMPY_AddBasicAAWrapperPass(LLVMPassManagerRef PM) {
-    unwrap(PM)->add(llvm::createBasicAAWrapperPass());
-}
-
-API_EXPORT(void)
-LLVMPY_AddDependenceAnalysisPass(LLVMPassManagerRef PM) {
-    unwrap(PM)->add(llvm::createDependenceAnalysisWrapperPass());
-}
-
-API_EXPORT(void)
-LLVMPY_AddCallGraphDOTPrinterPass(LLVMPassManagerRef PM) {
-    unwrap(PM)->add(llvm::createCallGraphDOTPrinterPass());
-}
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions