[mips] Initialize the long branch pass for testing purposes
llvm-svn: 332172
diff --git a/llvm/lib/Target/Mips/Mips.h b/llvm/lib/Target/Mips/Mips.h
index 1ca9ea1..641eece 100644
--- a/llvm/lib/Target/Mips/Mips.h
+++ b/llvm/lib/Target/Mips/Mips.h
@@ -43,6 +43,7 @@
MipsRegisterBankInfo &);
void initializeMipsDelaySlotFillerPass(PassRegistry &);
+ void initializeMipsLongBranchPass(PassRegistry &);
} // end namespace llvm;
#endif
diff --git a/llvm/lib/Target/Mips/MipsLongBranch.cpp b/llvm/lib/Target/Mips/MipsLongBranch.cpp
index 7a7c8ab..d31c639 100644
--- a/llvm/lib/Target/Mips/MipsLongBranch.cpp
+++ b/llvm/lib/Target/Mips/MipsLongBranch.cpp
@@ -77,8 +77,9 @@
public:
static char ID;
- MipsLongBranch()
- : MachineFunctionPass(ID), ABI(MipsABIInfo::Unknown()) {}
+ MipsLongBranch() : MachineFunctionPass(ID), ABI(MipsABIInfo::Unknown()) {
+ initializeMipsLongBranchPass(*PassRegistry::getPassRegistry());
+ }
StringRef getPassName() const override { return "Mips Long Branch"; }
@@ -108,6 +109,9 @@
char MipsLongBranch::ID = 0;
+INITIALIZE_PASS(MipsLongBranch, DEBUG_TYPE,
+ "Expand out of range branch instructions", false, false)
+
/// Iterate over list of Br's operands and search for a MachineBasicBlock
/// operand.
static MachineBasicBlock *getTargetMBB(const MachineInstr &Br) {
diff --git a/llvm/lib/Target/Mips/MipsTargetMachine.cpp b/llvm/lib/Target/Mips/MipsTargetMachine.cpp
index 77f43a2..2b9ac2c 100644
--- a/llvm/lib/Target/Mips/MipsTargetMachine.cpp
+++ b/llvm/lib/Target/Mips/MipsTargetMachine.cpp
@@ -54,6 +54,7 @@
PassRegistry *PR = PassRegistry::getPassRegistry();
initializeGlobalISel(*PR);
initializeMipsDelaySlotFillerPass(*PR);
+ initializeMipsLongBranchPass(*PR);
}
static std::string computeDataLayout(const Triple &TT, StringRef CPU,