[llvm] r340081 - [Hexagon] Remove unused functions from HexagonInstPrinter, NFC
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 17 14:12:37 PDT 2018
Author: kparzysz
Date: Fri Aug 17 14:12:37 2018
New Revision: 340081
URL: http://llvm.org/viewvc/llvm-project?rev=340081&view=rev
Log:
[Hexagon] Remove unused functions from HexagonInstPrinter, NFC
Modified:
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.h
Modified: llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp?rev=340081&r1=340080&r2=340081&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp Fri Aug 17 14:12:37 2018
@@ -28,26 +28,8 @@ using namespace llvm;
#define GET_INSTRUCTION_NAME
#include "HexagonGenAsmWriter.inc"
-HexagonInstPrinter::HexagonInstPrinter(MCAsmInfo const &MAI,
- MCInstrInfo const &MII,
- MCRegisterInfo const &MRI)
- : MCInstPrinter(MAI, MII, MRI), MII(MII), HasExtender(false) {
-}
-
-StringRef HexagonInstPrinter::getOpcodeName(unsigned Opcode) const {
- return MII.getName(Opcode);
-}
-
void HexagonInstPrinter::printRegName(raw_ostream &O, unsigned RegNo) const {
- O << getRegName(RegNo);
-}
-
-StringRef HexagonInstPrinter::getRegName(unsigned RegNo) const {
- return getRegisterName(RegNo);
-}
-
-void HexagonInstPrinter::setExtender(MCInst const &MCI) {
- HasExtender = HexagonMCInstrInfo::isImmext(MCI);
+ O << getRegisterName(RegNo);
}
void HexagonInstPrinter::printInst(const MCInst *MI, raw_ostream &OS,
@@ -65,7 +47,7 @@ void HexagonInstPrinter::printInst(const
printInstruction(MCI.getOperand(0).getInst(), OS);
} else
printInstruction(&MCI, OS);
- setExtender(MCI);
+ HasExtender = HexagonMCInstrInfo::isImmext(MCI);
OS << "\n";
}
@@ -97,72 +79,6 @@ void HexagonInstPrinter::printOperand(MC
}
}
-void HexagonInstPrinter::printExtOperand(MCInst const *MI, unsigned OpNo,
- raw_ostream &O) const {
- printOperand(MI, OpNo, O);
-}
-
-void HexagonInstPrinter::printUnsignedImmOperand(MCInst const *MI,
- unsigned OpNo,
- raw_ostream &O) const {
- O << MI->getOperand(OpNo).getImm();
-}
-
-void HexagonInstPrinter::printNegImmOperand(MCInst const *MI, unsigned OpNo,
- raw_ostream &O) const {
- O << -MI->getOperand(OpNo).getImm();
-}
-
-void HexagonInstPrinter::printNOneImmOperand(MCInst const *MI, unsigned OpNo,
- raw_ostream &O) const {
- O << -1;
-}
-
-void HexagonInstPrinter::printGlobalOperand(MCInst const *MI, unsigned OpNo,
- raw_ostream &O) const {
- printOperand(MI, OpNo, O);
-}
-
-void HexagonInstPrinter::printJumpTable(MCInst const *MI, unsigned OpNo,
- raw_ostream &O) const {
- assert(MI->getOperand(OpNo).isExpr() && "Expecting expression");
-
- printOperand(MI, OpNo, O);
-}
-
-void HexagonInstPrinter::printConstantPool(MCInst const *MI, unsigned OpNo,
- raw_ostream &O) const {
- assert(MI->getOperand(OpNo).isExpr() && "Expecting expression");
-
- printOperand(MI, OpNo, O);
-}
-
-void HexagonInstPrinter::printBranchOperand(MCInst const *MI, unsigned OpNo,
- raw_ostream &O) const {
- // Branches can take an immediate operand. This is used by the branch
- // selection pass to print $+8, an eight byte displacement from the PC.
- llvm_unreachable("Unknown branch operand.");
-}
-
-void HexagonInstPrinter::printCallOperand(MCInst const *MI, unsigned OpNo,
- raw_ostream &O) const {}
-
-void HexagonInstPrinter::printAbsAddrOperand(MCInst const *MI, unsigned OpNo,
- raw_ostream &O) const {}
-
-void HexagonInstPrinter::printPredicateOperand(MCInst const *MI, unsigned OpNo,
- raw_ostream &O) const {}
-
-void HexagonInstPrinter::printSymbol(MCInst const *MI, unsigned OpNo,
- raw_ostream &O, bool hi) const {
- assert(MI->getOperand(OpNo).isImm() && "Unknown symbol operand");
-
- O << '#' << (hi ? "HI" : "LO") << '(';
- O << '#';
- printOperand(MI, OpNo, O);
- O << ')';
-}
-
void HexagonInstPrinter::printBrtarget(MCInst const *MI, unsigned OpNo,
raw_ostream &O) const {
MCOperand const &MO = MI->getOperand(OpNo);
Modified: llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.h?rev=340081&r1=340080&r2=340081&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.h (original)
+++ llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.h Fri Aug 17 14:12:37 2018
@@ -26,57 +26,25 @@ namespace llvm {
class HexagonInstPrinter : public MCInstPrinter {
public:
explicit HexagonInstPrinter(MCAsmInfo const &MAI, MCInstrInfo const &MII,
- MCRegisterInfo const &MRI);
+ MCRegisterInfo const &MRI)
+ : MCInstPrinter(MAI, MII, MRI), MII(MII) {}
+
void printInst(MCInst const *MI, raw_ostream &O, StringRef Annot,
const MCSubtargetInfo &STI) override;
- virtual StringRef getOpcodeName(unsigned Opcode) const;
- void printInstruction(MCInst const *MI, raw_ostream &O);
+ void printRegName(raw_ostream &O, unsigned RegNo) const override;
- StringRef getRegName(unsigned RegNo) const;
static char const *getRegisterName(unsigned RegNo);
- void printRegName(raw_ostream &O, unsigned RegNo) const override;
+ void printInstruction(MCInst const *MI, raw_ostream &O);
void printOperand(MCInst const *MI, unsigned OpNo, raw_ostream &O) const;
- void printExtOperand(MCInst const *MI, unsigned OpNo, raw_ostream &O) const;
- void printUnsignedImmOperand(MCInst const *MI, unsigned OpNo,
- raw_ostream &O) const;
- void printNegImmOperand(MCInst const *MI, unsigned OpNo,
- raw_ostream &O) const;
- void printNOneImmOperand(MCInst const *MI, unsigned OpNo,
- raw_ostream &O) const;
- void printBranchOperand(MCInst const *MI, unsigned OpNo,
- raw_ostream &O) const;
- void printCallOperand(MCInst const *MI, unsigned OpNo, raw_ostream &O) const;
- void printAbsAddrOperand(MCInst const *MI, unsigned OpNo,
- raw_ostream &O) const;
- void printPredicateOperand(MCInst const *MI, unsigned OpNo,
- raw_ostream &O) const;
- void printGlobalOperand(MCInst const *MI, unsigned OpNo,
- raw_ostream &O) const;
- void printJumpTable(MCInst const *MI, unsigned OpNo, raw_ostream &O) const;
void printBrtarget(MCInst const *MI, unsigned OpNo, raw_ostream &O) const;
- void printConstantPool(MCInst const *MI, unsigned OpNo, raw_ostream &O) const;
-
- void printSymbolHi(MCInst const *MI, unsigned OpNo, raw_ostream &O) const {
- printSymbol(MI, OpNo, O, true);
- }
- void printSymbolLo(MCInst const *MI, unsigned OpNo, raw_ostream &O) const {
- printSymbol(MI, OpNo, O, false);
- }
-
MCAsmInfo const &getMAI() const { return MAI; }
MCInstrInfo const &getMII() const { return MII; }
-protected:
- void printSymbol(MCInst const *MI, unsigned OpNo, raw_ostream &O,
- bool hi) const;
-
private:
MCInstrInfo const &MII;
-
- bool HasExtender;
- void setExtender(MCInst const &MCI);
+ bool HasExtender = false;
};
} // end namespace llvm
More information about the llvm-commits
mailing list