summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-07-14 21:18:25 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-07-14 21:18:25 +0000
commit15a00a858a8364e18545fb8d3c8311f696c5557d (patch)
tree67be9a32081b820ca9d7d45549f3a7a12eff919a /llvm/lib
parent586b7419597b0bfe385eaa59b7f54d6e27dc7a6c (diff)
downloadbcm5719-llvm-15a00a858a8364e18545fb8d3c8311f696c5557d.tar.gz
bcm5719-llvm-15a00a858a8364e18545fb8d3c8311f696c5557d.zip
MIR Printer: move the function 'printReg'. NFC.
This commit moves the function 'printReg' towards the start of the file so that it can be used by the conversion methods in MIRPrinter and not just the printing methods in MIPrinter. llvm-svn: 242203
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/MIRPrinter.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp
index 0af2fbd94dd..ddc1d0a0cc1 100644
--- a/llvm/lib/CodeGen/MIRPrinter.cpp
+++ b/llvm/lib/CodeGen/MIRPrinter.cpp
@@ -90,6 +90,19 @@ template <> struct BlockScalarTraits<Module> {
} // end namespace yaml
} // end namespace llvm
+static void printReg(unsigned Reg, raw_ostream &OS,
+ const TargetRegisterInfo *TRI) {
+ // TODO: Print Stack Slots.
+ if (!Reg)
+ OS << '_';
+ else if (TargetRegisterInfo::isVirtualRegister(Reg))
+ OS << '%' << TargetRegisterInfo::virtReg2Index(Reg);
+ else if (Reg < TRI->getNumRegs())
+ OS << '%' << StringRef(TRI->getName(Reg)).lower();
+ else
+ llvm_unreachable("Can't print this kind of register yet");
+}
+
void MIRPrinter::print(const MachineFunction &MF) {
initRegisterMaskIds(MF);
@@ -271,19 +284,6 @@ void MIPrinter::print(const MachineInstr &MI) {
}
}
-static void printReg(unsigned Reg, raw_ostream &OS,
- const TargetRegisterInfo *TRI) {
- // TODO: Print Stack Slots.
- if (!Reg)
- OS << '_';
- else if (TargetRegisterInfo::isVirtualRegister(Reg))
- OS << '%' << TargetRegisterInfo::virtReg2Index(Reg);
- else if (Reg < TRI->getNumRegs())
- OS << '%' << StringRef(TRI->getName(Reg)).lower();
- else
- llvm_unreachable("Can't print this kind of register yet");
-}
-
void MIPrinter::printMBBReference(const MachineBasicBlock &MBB) {
OS << "%bb." << MBB.getNumber();
if (const auto *BB = MBB.getBasicBlock()) {
OpenPOWER on IntegriCloud