forked from OSchip/llvm-project
parent
565896b9eb
commit
fa1f67ea38
|
@ -43,7 +43,6 @@
|
||||||
#include "llvm/Target/TargetRegistry.h"
|
#include "llvm/Target/TargetRegistry.h"
|
||||||
#include "llvm/ADT/SmallPtrSet.h"
|
#include "llvm/ADT/SmallPtrSet.h"
|
||||||
#include "llvm/ADT/SmallString.h"
|
#include "llvm/ADT/SmallString.h"
|
||||||
#include "llvm/ADT/Statistic.h"
|
|
||||||
#include "llvm/ADT/StringExtras.h"
|
#include "llvm/ADT/StringExtras.h"
|
||||||
#include "llvm/ADT/StringSet.h"
|
#include "llvm/ADT/StringSet.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
@ -53,8 +52,6 @@
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
STATISTIC(EmittedInsts, "Number of machine instrs printed");
|
|
||||||
|
|
||||||
static cl::opt<bool>
|
static cl::opt<bool>
|
||||||
EnableMCInst("enable-arm-mcinst-printer", cl::Hidden,
|
EnableMCInst("enable-arm-mcinst-printer", cl::Hidden,
|
||||||
cl::desc("enable experimental asmprinter gunk in the arm backend"));
|
cl::desc("enable experimental asmprinter gunk in the arm backend"));
|
||||||
|
@ -162,7 +159,7 @@ namespace {
|
||||||
void printInstruction(const MachineInstr *MI); // autogenerated.
|
void printInstruction(const MachineInstr *MI); // autogenerated.
|
||||||
static const char *getRegisterName(unsigned RegNo);
|
static const char *getRegisterName(unsigned RegNo);
|
||||||
|
|
||||||
void printMachineInstruction(const MachineInstr *MI);
|
virtual void EmitInstruction(const MachineInstr *MI);
|
||||||
bool runOnMachineFunction(MachineFunction &F);
|
bool runOnMachineFunction(MachineFunction &F);
|
||||||
|
|
||||||
virtual void EmitConstantPool() {} // we emit constant pools customly!
|
virtual void EmitConstantPool() {} // we emit constant pools customly!
|
||||||
|
@ -262,37 +259,8 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
||||||
SetupMachineFunction(MF);
|
SetupMachineFunction(MF);
|
||||||
O << "\n";
|
O << "\n";
|
||||||
|
|
||||||
// NOTE: we don't print out constant pools here, they are handled as
|
|
||||||
// instructions.
|
|
||||||
EmitFunctionHeader();
|
EmitFunctionHeader();
|
||||||
|
EmitFunctionBody();
|
||||||
// Print out code for the function.
|
|
||||||
for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
|
|
||||||
I != E; ++I) {
|
|
||||||
// Print a label for the basic block.
|
|
||||||
EmitBasicBlockStart(I);
|
|
||||||
|
|
||||||
// Print the assembly for the instruction.
|
|
||||||
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
|
|
||||||
II != E; ++II)
|
|
||||||
printMachineInstruction(II);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Subtarget->isTargetDarwin()) {
|
|
||||||
// If the function is empty, then we need to emit *something*. Otherwise,
|
|
||||||
// the function's label might be associated with something that it wasn't
|
|
||||||
// meant to be associated with. We emit a noop in this situation.
|
|
||||||
MachineFunction::iterator I = MF.begin();
|
|
||||||
if (++I == MF.end() && MF.front().empty())
|
|
||||||
O << "\tnop\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (MAI->hasDotTypeDotSizeDirective())
|
|
||||||
O << "\t.size " << *CurrentFnSym << ", .-" << *CurrentFnSym << "\n";
|
|
||||||
|
|
||||||
// Emit post-function debug information.
|
|
||||||
DW->EndFunction(&MF);
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1061,12 +1029,7 @@ bool ARMAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ARMAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
|
void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
||||||
++EmittedInsts;
|
|
||||||
|
|
||||||
// Call the autogenerated instruction printer routines.
|
|
||||||
processDebugLoc(MI, true);
|
|
||||||
|
|
||||||
if (EnableMCInst) {
|
if (EnableMCInst) {
|
||||||
printInstructionThroughMCStreamer(MI);
|
printInstructionThroughMCStreamer(MI);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1076,11 +1039,6 @@ void ARMAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
|
||||||
|
|
||||||
printInstruction(MI);
|
printInstruction(MI);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VerboseAsm)
|
|
||||||
EmitComments(*MI);
|
|
||||||
O << '\n';
|
|
||||||
processDebugLoc(MI, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ARMAsmPrinter::EmitStartOfAsmFile(Module &M) {
|
void ARMAsmPrinter::EmitStartOfAsmFile(Module &M) {
|
||||||
|
|
Loading…
Reference in New Issue