Skip to content

Commit f54df0d

Browse files
authored
[LLVM][NFC] Move PassPlugin from Passes to separate library
This avoid pulling in the entire Passes library with all passes as dependencies when just referring to PassPlugin, which is in fact independent of the Passes themselves. Pull Request: #173279
1 parent c471bad commit f54df0d

File tree

37 files changed

+46
-30
lines changed

37 files changed

+46
-30
lines changed

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
#include "llvm/MC/TargetRegistry.h"
4242
#include "llvm/Object/OffloadBinary.h"
4343
#include "llvm/Passes/PassBuilder.h"
44-
#include "llvm/Passes/PassPlugin.h"
4544
#include "llvm/Passes/StandardInstrumentations.h"
45+
#include "llvm/Plugins/PassPlugin.h"
4646
#include "llvm/ProfileData/InstrProfCorrelator.h"
4747
#include "llvm/Support/BuryPointer.h"
4848
#include "llvm/Support/CommandLine.h"

clang/lib/CodeGen/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ set(LLVM_LINK_COMPONENTS
2525
ObjCARCOpts
2626
Object
2727
Passes
28+
Plugins
2829
ProfileData
2930
ScalarOpts
3031
Support

clang/tools/clang-linker-wrapper/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ set(LLVM_LINK_COMPONENTS
88
TransformUtils
99
Analysis
1010
Passes
11+
Plugins
1112
IRReader
1213
Object
1314
Option

clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include "llvm/Option/ArgList.h"
3939
#include "llvm/Option/OptTable.h"
4040
#include "llvm/Option/Option.h"
41-
#include "llvm/Passes/PassPlugin.h"
41+
#include "llvm/Plugins/PassPlugin.h"
4242
#include "llvm/Remarks/HotnessThresholdParser.h"
4343
#include "llvm/Support/CommandLine.h"
4444
#include "llvm/Support/Errc.h"

flang/lib/Frontend/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ add_flang_library(flangFrontend
4646

4747
LINK_COMPONENTS
4848
Passes
49+
Plugins
4950
Analysis
5051
BitReader
5152
Extensions

flang/lib/Frontend/FrontendActions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
#include "llvm/Linker/Linker.h"
5656
#include "llvm/Object/OffloadBinary.h"
5757
#include "llvm/Passes/PassBuilder.h"
58-
#include "llvm/Passes/PassPlugin.h"
5958
#include "llvm/Passes/StandardInstrumentations.h"
59+
#include "llvm/Plugins/PassPlugin.h"
6060
#include "llvm/ProfileData/InstrProfCorrelator.h"
6161
#include "llvm/Support/AMDGPUAddrSpace.h"
6262
#include "llvm/Support/Error.h"

llvm/examples/Bye/Bye.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "llvm/IR/LegacyPassManager.h"
33
#include "llvm/Pass.h"
44
#include "llvm/Passes/PassBuilder.h"
5-
#include "llvm/Passes/PassPlugin.h"
5+
#include "llvm/Plugins/PassPlugin.h"
66
#include "llvm/Support/CommandLine.h"
77
#include "llvm/Support/raw_ostream.h"
88

llvm/examples/IRTransforms/SimplifyCFG.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include "llvm/IR/PassManager.h"
3939
#include "llvm/IR/PatternMatch.h"
4040
#include "llvm/Passes/PassBuilder.h"
41-
#include "llvm/Passes/PassPlugin.h"
41+
#include "llvm/Plugins/PassPlugin.h"
4242
#include "llvm/Support/CommandLine.h"
4343

4444
using namespace llvm;
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===- llvm/Passes/PassPlugin.h - Public Plugin API -----------------------===//
1+
//===----------------------------------------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -10,8 +10,8 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#ifndef LLVM_PASSES_PASSPLUGIN_H
14-
#define LLVM_PASSES_PASSPLUGIN_H
13+
#ifndef LLVM_PLUGINS_PASSPLUGIN_H
14+
#define LLVM_PLUGINS_PASSPLUGIN_H
1515

1616
#include "llvm/ADT/StringRef.h"
1717
#include "llvm/Support/CodeGen.h"
@@ -112,7 +112,7 @@ class PassPlugin {
112112
sys::DynamicLibrary Library;
113113
PassPluginLibraryInfo Info;
114114
};
115-
}
115+
} // namespace llvm
116116

117117
// The function returns a struct with default initializers.
118118
#ifdef __clang__
@@ -139,4 +139,4 @@ llvmGetPassPluginInfo();
139139
#pragma clang diagnostic pop
140140
#endif
141141

142-
#endif /* LLVM_PASSES_PASSPLUGIN_H */
142+
#endif /* LLVM_PLUGINS_PASSPLUGIN_H */

llvm/lib/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ add_subdirectory(AsmParser)
4141
add_subdirectory(LineEditor)
4242
add_subdirectory(ProfileData)
4343
add_subdirectory(Passes)
44+
add_subdirectory(Plugins)
4445
add_subdirectory(TargetParser)
4546
add_subdirectory(TextAPI)
4647
add_subdirectory(Telemetry)

0 commit comments

Comments
 (0)