Skip to content

Commit

Permalink
[llvm-c] Remove bindings for creating legacy passes
Browse files Browse the repository at this point in the history
Legacy passes are only supported for codegen, and I don't believe
it's possible to write backends using the C API, so we should drop
all of those. Reduces the number of places that need to be modified
when removing legacy passes.

Differential Revision: https://reviews.llvm.org/D144970
  • Loading branch information
nikic committed Mar 2, 2023
1 parent 5705dc7 commit f7ca013
Show file tree
Hide file tree
Showing 13 changed files with 3 additions and 535 deletions.
2 changes: 0 additions & 2 deletions clang/docs/tools/clang-formatted-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5713,8 +5713,6 @@ llvm/include/llvm-c/OrcEE.h
llvm/include/llvm-c/Remarks.h
llvm/include/llvm-c/Types.h
llvm/include/llvm-c/Transforms/PassBuilder.h
llvm/include/llvm-c/Transforms/Scalar.h
llvm/include/llvm-c/Transforms/Vectorize.h
llvm/lib/Analysis/CodeMetrics.cpp
llvm/lib/Analysis/CycleAnalysis.cpp
llvm/lib/Analysis/DDGPrinter.cpp
Expand Down
2 changes: 2 additions & 0 deletions llvm/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ Changes to the C API

* ``LLVMContextSetOpaquePointers``, a temporary API to pin to legacy typed
pointer, has been removed.
* Functions for adding legacy passes like ``LLVMAddInstructionCombiningPass``
have been removed.

Changes to the FastISel infrastructure
--------------------------------------
Expand Down
45 changes: 0 additions & 45 deletions llvm/include/llvm-c/Transforms/IPO.h

This file was deleted.

40 changes: 0 additions & 40 deletions llvm/include/llvm-c/Transforms/InstCombine.h

This file was deleted.

152 changes: 0 additions & 152 deletions llvm/include/llvm-c/Transforms/Scalar.h

This file was deleted.

50 changes: 0 additions & 50 deletions llvm/include/llvm-c/Transforms/Utils.h

This file was deleted.

47 changes: 0 additions & 47 deletions llvm/include/llvm-c/Transforms/Vectorize.h

This file was deleted.

9 changes: 0 additions & 9 deletions llvm/lib/Transforms/IPO/IPO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
//
//===----------------------------------------------------------------------===//

#include "llvm-c/Transforms/IPO.h"
#include "llvm-c/Initialization.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/InitializePasses.h"
Expand All @@ -34,11 +33,3 @@ void llvm::initializeIPO(PassRegistry &Registry) {
void LLVMInitializeIPO(LLVMPassRegistryRef R) {
initializeIPO(*unwrap(R));
}

void LLVMAddDeadArgEliminationPass(LLVMPassManagerRef PM) {
unwrap(PM)->add(createDeadArgEliminationPass());
}

void LLVMAddAlwaysInlinerPass(LLVMPassManagerRef PM) {
unwrap(PM)->add(llvm::createAlwaysInlinerLegacyPass());
}
5 changes: 0 additions & 5 deletions llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

#include "InstCombineInternal.h"
#include "llvm-c/Initialization.h"
#include "llvm-c/Transforms/InstCombine.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
Expand Down Expand Up @@ -4760,7 +4759,3 @@ FunctionPass *llvm::createInstructionCombiningPass() {
FunctionPass *llvm::createInstructionCombiningPass(unsigned MaxIterations) {
return new InstructionCombiningPass(MaxIterations);
}

void LLVMAddInstructionCombiningPass(LLVMPassManagerRef PM) {
unwrap(PM)->add(createInstructionCombiningPass());
}
Loading

0 comments on commit f7ca013

Please sign in to comment.