aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/Sparc/SparcAsmPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-02-05 05:50:24 +0000
committerChris Lattner <sabre@nondot.org>2006-02-05 05:50:24 +0000
commit7c90f73a1b06040d971a3dd95a491031ae6238d5 (patch)
treeb08b13069e8e41b83636b53103804110e993d376 /lib/Target/Sparc/SparcAsmPrinter.cpp
parent213845367cb394237cbf10ccfba5a219bbec4781 (diff)
downloadexternal_llvm-7c90f73a1b06040d971a3dd95a491031ae6238d5.zip
external_llvm-7c90f73a1b06040d971a3dd95a491031ae6238d5.tar.gz
external_llvm-7c90f73a1b06040d971a3dd95a491031ae6238d5.tar.bz2
Rename SPARC V8 target to be the LLVM SPARC target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25985 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Sparc/SparcAsmPrinter.cpp')
-rw-r--r--lib/Target/Sparc/SparcAsmPrinter.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/lib/Target/Sparc/SparcAsmPrinter.cpp b/lib/Target/Sparc/SparcAsmPrinter.cpp
index dd1b469..2e88db6 100644
--- a/lib/Target/Sparc/SparcAsmPrinter.cpp
+++ b/lib/Target/Sparc/SparcAsmPrinter.cpp
@@ -1,4 +1,4 @@
-//===-- SparcV8AsmPrinter.cpp - SparcV8 LLVM assembly writer --------------===//
+//===-- SparcAsmPrinter.cpp - Sparc LLVM assembly writer ------------------===//
//
// The LLVM Compiler Infrastructure
//
@@ -8,12 +8,12 @@
//===----------------------------------------------------------------------===//
//
// This file contains a printer that converts from our internal representation
-// of machine-dependent LLVM code to GAS-format Sparc V8 assembly language.
+// of machine-dependent LLVM code to GAS-format SPARC assembly language.
//
//===----------------------------------------------------------------------===//
-#include "SparcV8.h"
-#include "SparcV8InstrInfo.h"
+#include "Sparc.h"
+#include "SparcInstrInfo.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Module.h"
@@ -35,8 +35,8 @@ using namespace llvm;
namespace {
Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed");
- struct SparcV8AsmPrinter : public AsmPrinter {
- SparcV8AsmPrinter(std::ostream &O, TargetMachine &TM) : AsmPrinter(O, TM) {
+ struct SparcAsmPrinter : public AsmPrinter {
+ SparcAsmPrinter(std::ostream &O, TargetMachine &TM) : AsmPrinter(O, TM) {
Data16bitsDirective = "\t.half\t";
Data32bitsDirective = "\t.word\t";
Data64bitsDirective = 0; // .xword is only supported by V9.
@@ -53,12 +53,12 @@ namespace {
ValueMapTy NumberForBB;
virtual const char *getPassName() const {
- return "SparcV8 Assembly Printer";
+ return "Sparc Assembly Printer";
}
void printOperand(const MachineInstr *MI, int opNum);
void printMemOperand(const MachineInstr *MI, int opNum);
- void printV8CCOperand(const MachineInstr *MI, int opNum);
+ void printCCOperand(const MachineInstr *MI, int opNum);
bool printInstruction(const MachineInstr *MI); // autogenerated.
bool runOnMachineFunction(MachineFunction &F);
@@ -67,22 +67,22 @@ namespace {
};
} // end of anonymous namespace
-#include "SparcV8GenAsmWriter.inc"
+#include "SparcGenAsmWriter.inc"
-/// createSparcV8CodePrinterPass - Returns a pass that prints the SparcV8
+/// createSparcCodePrinterPass - Returns a pass that prints the SPARC
/// assembly code for a MachineFunction to the given output stream,
/// using the given target machine description. This should work
/// regardless of whether the function is in SSA form.
///
-FunctionPass *llvm::createSparcV8CodePrinterPass (std::ostream &o,
- TargetMachine &tm) {
- return new SparcV8AsmPrinter(o, tm);
+FunctionPass *llvm::createSparcCodePrinterPass(std::ostream &o,
+ TargetMachine &tm) {
+ return new SparcAsmPrinter(o, tm);
}
/// runOnMachineFunction - This uses the printMachineInstruction()
/// method to print assembly for each instruction.
///
-bool SparcV8AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+bool SparcAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
SetupMachineFunction(MF);
// Print out constants referenced by the function
@@ -132,14 +132,14 @@ bool SparcV8AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
return false;
}
-void SparcV8AsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
+void SparcAsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
const MachineOperand &MO = MI->getOperand (opNum);
const MRegisterInfo &RI = *TM.getRegisterInfo();
bool CloseParen = false;
- if (MI->getOpcode() == V8::SETHIi && !MO.isRegister() && !MO.isImmediate()) {
+ if (MI->getOpcode() == SP::SETHIi && !MO.isRegister() && !MO.isImmediate()) {
O << "%hi(";
CloseParen = true;
- } else if ((MI->getOpcode() == V8::ORri || MI->getOpcode() == V8::ADDri)
+ } else if ((MI->getOpcode() == SP::ORri || MI->getOpcode() == SP::ADDri)
&& !MO.isRegister() && !MO.isImmediate()) {
O << "%lo(";
CloseParen = true;
@@ -170,7 +170,7 @@ void SparcV8AsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
return;
}
case MachineOperand::MO_PCRelativeDisp:
- std::cerr << "Shouldn't use addPCDisp() when building SparcV8 MachineInstrs";
+ std::cerr << "Shouldn't use addPCDisp() when building Sparc MachineInstrs";
abort ();
return;
case MachineOperand::MO_GlobalAddress:
@@ -189,13 +189,13 @@ void SparcV8AsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
if (CloseParen) O << ")";
}
-void SparcV8AsmPrinter::printMemOperand(const MachineInstr *MI, int opNum) {
+void SparcAsmPrinter::printMemOperand(const MachineInstr *MI, int opNum) {
printOperand(MI, opNum);
MachineOperand::MachineOperandType OpTy = MI->getOperand(opNum+1).getType();
if ((OpTy == MachineOperand::MO_VirtualRegister ||
OpTy == MachineOperand::MO_MachineRegister) &&
- MI->getOperand(opNum+1).getReg() == V8::G0)
+ MI->getOperand(opNum+1).getReg() == SP::G0)
return; // don't print "+%g0"
if ((OpTy == MachineOperand::MO_SignExtendedImmed ||
OpTy == MachineOperand::MO_UnextendedImmed) &&
@@ -213,19 +213,19 @@ void SparcV8AsmPrinter::printMemOperand(const MachineInstr *MI, int opNum) {
}
}
-void SparcV8AsmPrinter::printV8CCOperand(const MachineInstr *MI, int opNum) {
+void SparcAsmPrinter::printCCOperand(const MachineInstr *MI, int opNum) {
int CC = (int)MI->getOperand(opNum).getImmedValue();
- O << SPARCCondCodeToString((V8CC::CondCodes)CC);
+ O << SPARCCondCodeToString((SPCC::CondCodes)CC);
}
-bool SparcV8AsmPrinter::doInitialization(Module &M) {
+bool SparcAsmPrinter::doInitialization(Module &M) {
Mang = new Mangler(M);
return false; // success
}
-bool SparcV8AsmPrinter::doFinalization(Module &M) {
+bool SparcAsmPrinter::doFinalization(Module &M) {
const TargetData &TD = TM.getTargetData();
// Print out module-level global variables here.