aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/IA64
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-02-24 08:30:20 +0000
committerBill Wendling <isanbard@gmail.com>2009-02-24 08:30:20 +0000
commit4f40531823c2b995149ff3a1b721171ad6942363 (patch)
tree543149bc13d79de8e79f707ddbf23da88f704425 /lib/Target/IA64
parenta8b04a1f436ca87663de0be701ba9b998ad3ad8c (diff)
downloadexternal_llvm-4f40531823c2b995149ff3a1b721171ad6942363.zip
external_llvm-4f40531823c2b995149ff3a1b721171ad6942363.tar.gz
external_llvm-4f40531823c2b995149ff3a1b721171ad6942363.tar.bz2
Overhaul my earlier submission due to feedback. It's a large patch, but most of
them are generic changes. - Use the "fast" flag that's already being passed into the asm printers instead of shoving it into the DwarfWriter. - Instead of calling "MI->getParent()->getParent()" for every MI, set the machine function when calling "runOnMachineFunction" in the asm printers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65379 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/IA64')
-rw-r--r--lib/Target/IA64/IA64.h4
-rw-r--r--lib/Target/IA64/IA64AsmPrinter.cpp17
-rw-r--r--lib/Target/IA64/IA64TargetMachine.cpp2
3 files changed, 14 insertions, 9 deletions
diff --git a/lib/Target/IA64/IA64.h b/lib/Target/IA64/IA64.h
index 030a233..ab9e677 100644
--- a/lib/Target/IA64/IA64.h
+++ b/lib/Target/IA64/IA64.h
@@ -35,7 +35,9 @@ FunctionPass *createIA64BundlingPass(IA64TargetMachine &TM);
/// using the given target machine description. This should work
/// regardless of whether the function is in SSA form.
///
-FunctionPass *createIA64CodePrinterPass(raw_ostream &o, IA64TargetMachine &tm);
+FunctionPass *createIA64CodePrinterPass(raw_ostream &o,
+ IA64TargetMachine &tm,
+ bool fast);
} // End llvm namespace
diff --git a/lib/Target/IA64/IA64AsmPrinter.cpp b/lib/Target/IA64/IA64AsmPrinter.cpp
index 567e04c..0047430 100644
--- a/lib/Target/IA64/IA64AsmPrinter.cpp
+++ b/lib/Target/IA64/IA64AsmPrinter.cpp
@@ -34,12 +34,12 @@ using namespace llvm;
STATISTIC(EmittedInsts, "Number of machine instrs printed");
namespace {
- struct IA64AsmPrinter : public AsmPrinter {
+ class IA64AsmPrinter : public AsmPrinter {
std::set<std::string> ExternalFunctionNames, ExternalObjectNames;
-
- IA64AsmPrinter(raw_ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
- : AsmPrinter(O, TM, T) {
- }
+ public:
+ IA64AsmPrinter(raw_ostream &O, TargetMachine &TM,
+ const TargetAsmInfo *T, bool F)
+ : AsmPrinter(O, TM, T, F) {}
virtual const char *getPassName() const {
return "IA64 Assembly Printer";
@@ -124,6 +124,8 @@ namespace {
/// method to print assembly for each instruction.
///
bool IA64AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+ this->MF = &MF;
+
SetupMachineFunction(MF);
O << "\n\n";
@@ -365,6 +367,7 @@ bool IA64AsmPrinter::doFinalization(Module &M) {
/// the given target machine description.
///
FunctionPass *llvm::createIA64CodePrinterPass(raw_ostream &o,
- IA64TargetMachine &tm) {
- return new IA64AsmPrinter(o, tm, tm.getTargetAsmInfo());
+ IA64TargetMachine &tm,
+ bool fast) {
+ return new IA64AsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
}
diff --git a/lib/Target/IA64/IA64TargetMachine.cpp b/lib/Target/IA64/IA64TargetMachine.cpp
index 459e8ed..1cac9e4 100644
--- a/lib/Target/IA64/IA64TargetMachine.cpp
+++ b/lib/Target/IA64/IA64TargetMachine.cpp
@@ -84,7 +84,7 @@ bool IA64TargetMachine::addPreEmitPass(PassManagerBase &PM, bool Fast) {
}
bool IA64TargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast,
raw_ostream &Out) {
- PM.add(createIA64CodePrinterPass(Out, *this));
+ PM.add(createIA64CodePrinterPass(Out, *this, Fast));
return false;
}