summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/InstPrinter
diff options
context:
space:
mode:
authorJack Carter <jcarter@mips.com>2013-02-05 08:32:10 +0000
committerJack Carter <jcarter@mips.com>2013-02-05 08:32:10 +0000
commit9c1a027fe884c11f0302534edbc6320f8c83999d (patch)
tree875eaf2b1374f0a3404479b6444f9ae0b31d5fd8 /llvm/lib/Target/Mips/InstPrinter
parent31876b4efd5efcd8517d57fb998aed915bfdd6d4 (diff)
downloadbcm5719-llvm-9c1a027fe884c11f0302534edbc6320f8c83999d.tar.gz
bcm5719-llvm-9c1a027fe884c11f0302534edbc6320f8c83999d.zip
This patch that sets the EmitAlias flag in td files
and enables the instruction printer to print aliased instructions. Due to usage of RegisterOperands a change in common code (utils/TableGen/AsmWriterEmitter.cpp) is required to get the correct register value if it is a RegisterOperand. Contributer: Vladimir Medic llvm-svn: 174358
Diffstat (limited to 'llvm/lib/Target/Mips/InstPrinter')
-rw-r--r--llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp5
-rw-r--r--llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp b/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp
index 97c367fbf1a..fc23cd38035 100644
--- a/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp
+++ b/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp
@@ -23,6 +23,7 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
+#define PRINT_ALIAS_INSTR
#include "MipsGenAsmWriter.inc"
const char* Mips::MipsFCCToString(Mips::CondCode CC) {
@@ -78,7 +79,9 @@ void MipsInstPrinter::printInst(const MCInst *MI, raw_ostream &O,
O << "\t.set\tmips32r2\n";
}
- printInstruction(MI, O);
+ // Try to print any aliases first.
+ if (!printAliasInstr(MI, O))
+ printInstruction(MI, O);
printAnnotation(O, Annot);
switch (MI->getOpcode()) {
diff --git a/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.h b/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.h
index 38cac688015..d1b561f9764 100644
--- a/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.h
+++ b/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.h
@@ -89,6 +89,8 @@ public:
virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot);
void printCPURegs(const MCInst *MI, unsigned OpNo, raw_ostream &O);
+ bool printAliasInstr(const MCInst *MI, raw_ostream &OS);
+
private:
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
void printUnsignedImm(const MCInst *MI, int opNum, raw_ostream &O);
OpenPOWER on IntegriCloud