Skip to content

Commit f7ca013

Browse files
committed
[llvm-c] Remove bindings for creating legacy passes
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
1 parent 5705dc7 commit f7ca013

File tree

13 files changed

+3
-535
lines changed

13 files changed

+3
-535
lines changed

clang/docs/tools/clang-formatted-files.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5713,8 +5713,6 @@ llvm/include/llvm-c/OrcEE.h
57135713
llvm/include/llvm-c/Remarks.h
57145714
llvm/include/llvm-c/Types.h
57155715
llvm/include/llvm-c/Transforms/PassBuilder.h
5716-
llvm/include/llvm-c/Transforms/Scalar.h
5717-
llvm/include/llvm-c/Transforms/Vectorize.h
57185716
llvm/lib/Analysis/CodeMetrics.cpp
57195717
llvm/lib/Analysis/CycleAnalysis.cpp
57205718
llvm/lib/Analysis/DDGPrinter.cpp

llvm/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ Changes to the C API
145145

146146
* ``LLVMContextSetOpaquePointers``, a temporary API to pin to legacy typed
147147
pointer, has been removed.
148+
* Functions for adding legacy passes like ``LLVMAddInstructionCombiningPass``
149+
have been removed.
148150

149151
Changes to the FastISel infrastructure
150152
--------------------------------------

llvm/include/llvm-c/Transforms/IPO.h

Lines changed: 0 additions & 45 deletions
This file was deleted.

llvm/include/llvm-c/Transforms/InstCombine.h

Lines changed: 0 additions & 40 deletions
This file was deleted.

llvm/include/llvm-c/Transforms/Scalar.h

Lines changed: 0 additions & 152 deletions
This file was deleted.

llvm/include/llvm-c/Transforms/Utils.h

Lines changed: 0 additions & 50 deletions
This file was deleted.

llvm/include/llvm-c/Transforms/Vectorize.h

Lines changed: 0 additions & 47 deletions
This file was deleted.

llvm/lib/Transforms/IPO/IPO.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#include "llvm-c/Transforms/IPO.h"
1615
#include "llvm-c/Initialization.h"
1716
#include "llvm/IR/LegacyPassManager.h"
1817
#include "llvm/InitializePasses.h"
@@ -34,11 +33,3 @@ void llvm::initializeIPO(PassRegistry &Registry) {
3433
void LLVMInitializeIPO(LLVMPassRegistryRef R) {
3534
initializeIPO(*unwrap(R));
3635
}
37-
38-
void LLVMAddDeadArgEliminationPass(LLVMPassManagerRef PM) {
39-
unwrap(PM)->add(createDeadArgEliminationPass());
40-
}
41-
42-
void LLVMAddAlwaysInlinerPass(LLVMPassManagerRef PM) {
43-
unwrap(PM)->add(llvm::createAlwaysInlinerLegacyPass());
44-
}

llvm/lib/Transforms/InstCombine/InstructionCombining.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434

3535
#include "InstCombineInternal.h"
3636
#include "llvm-c/Initialization.h"
37-
#include "llvm-c/Transforms/InstCombine.h"
3837
#include "llvm/ADT/APInt.h"
3938
#include "llvm/ADT/ArrayRef.h"
4039
#include "llvm/ADT/DenseMap.h"
@@ -4760,7 +4759,3 @@ FunctionPass *llvm::createInstructionCombiningPass() {
47604759
FunctionPass *llvm::createInstructionCombiningPass(unsigned MaxIterations) {
47614760
return new InstructionCombiningPass(MaxIterations);
47624761
}
4763-
4764-
void LLVMAddInstructionCombiningPass(LLVMPassManagerRef PM) {
4765-
unwrap(PM)->add(createInstructionCombiningPass());
4766-
}

0 commit comments

Comments
 (0)