Skip to content

Commit 7073676

Browse files
authored
[NFC][LLVM][DirectX] Cleanup pass initialization for DirectX (#134419)
- Remove calls to pass initialization from pass constructors. - #111767
1 parent a3754ad commit 7073676

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

llvm/lib/Target/DirectX/DXContainerGlobals.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ class DXContainerGlobals : public llvm::ModulePass {
5151

5252
public:
5353
static char ID; // Pass identification, replacement for typeid
54-
DXContainerGlobals() : ModulePass(ID) {
55-
initializeDXContainerGlobalsPass(*PassRegistry::getPassRegistry());
56-
}
54+
DXContainerGlobals() : ModulePass(ID) {}
5755

5856
StringRef getPassName() const override {
5957
return "DXContainer Global Emitter";

llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,13 +262,8 @@ class DXILPrettyPrinterLegacy : public llvm::ModulePass {
262262

263263
public:
264264
static char ID;
265-
DXILPrettyPrinterLegacy() : ModulePass(ID), OS(dbgs()) {
266-
initializeDXILPrettyPrinterLegacyPass(*PassRegistry::getPassRegistry());
267-
}
268265

269-
explicit DXILPrettyPrinterLegacy(raw_ostream &O) : ModulePass(ID), OS(O) {
270-
initializeDXILPrettyPrinterLegacyPass(*PassRegistry::getPassRegistry());
271-
}
266+
explicit DXILPrettyPrinterLegacy(raw_ostream &O) : ModulePass(ID), OS(O) {}
272267

273268
StringRef getPassName() const override {
274269
return "DXIL Metadata Pretty Printer";

llvm/lib/Target/DirectX/DirectXTargetMachine.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeDirectXTarget() {
6464
initializeShaderFlagsAnalysisWrapperPass(*PR);
6565
initializeRootSignatureAnalysisWrapperPass(*PR);
6666
initializeDXILFinalizeLinkageLegacyPass(*PR);
67+
initializeDXILPrettyPrinterLegacyPass(*PR);
6768
}
6869

6970
class DXILTargetObjectFile : public TargetLoweringObjectFile {

0 commit comments

Comments
 (0)