[llvm-commits] [llvm] r65380 - in /llvm/branches/Apple/Dib: include/llvm/CodeGen/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/Target/ARM/ lib/Target/ARM/AsmPrinter/ lib/Target/Alpha/ lib/Target/Alpha/AsmPrinter/ lib/Target/CellSPU/ lib/Target/CellSPU/AsmPrinter/ lib/Target/IA64/ lib/Target/Mips/ lib/Target/PIC16/ lib/Target/PowerPC/ lib/Target/PowerPC/AsmPrinter/ lib/Target/Sparc/ lib/Target/Sparc/AsmPrinter/ lib/Target/X86/ lib/Target/X86/AsmPrinter/ lib/Target/XCore/ utils/TableGen/
Bill Wendling
isanbard at gmail.com
Tue Feb 24 00:33:48 PST 2009
Author: void
Date: Tue Feb 24 02:33:47 2009
New Revision: 65380
URL: http://llvm.org/viewvc/llvm-project?rev=65380&view=rev
Log:
Pull r65379 into Dib:
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.
Modified:
llvm/branches/Apple/Dib/include/llvm/CodeGen/AsmPrinter.h
llvm/branches/Apple/Dib/include/llvm/CodeGen/DwarfWriter.h
llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/FastISel.cpp
llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
llvm/branches/Apple/Dib/lib/Target/ARM/ARM.h
llvm/branches/Apple/Dib/lib/Target/ARM/ARMTargetMachine.cpp
llvm/branches/Apple/Dib/lib/Target/ARM/ARMTargetMachine.h
llvm/branches/Apple/Dib/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
llvm/branches/Apple/Dib/lib/Target/Alpha/Alpha.h
llvm/branches/Apple/Dib/lib/Target/Alpha/AlphaTargetMachine.cpp
llvm/branches/Apple/Dib/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
llvm/branches/Apple/Dib/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
llvm/branches/Apple/Dib/lib/Target/CellSPU/SPU.h
llvm/branches/Apple/Dib/lib/Target/CellSPU/SPUTargetMachine.cpp
llvm/branches/Apple/Dib/lib/Target/IA64/IA64.h
llvm/branches/Apple/Dib/lib/Target/IA64/IA64AsmPrinter.cpp
llvm/branches/Apple/Dib/lib/Target/IA64/IA64TargetMachine.cpp
llvm/branches/Apple/Dib/lib/Target/Mips/Mips.h
llvm/branches/Apple/Dib/lib/Target/Mips/MipsAsmPrinter.cpp
llvm/branches/Apple/Dib/lib/Target/Mips/MipsTargetMachine.cpp
llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16.h
llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16AsmPrinter.cpp
llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16AsmPrinter.h
llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16TargetMachine.cpp
llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
llvm/branches/Apple/Dib/lib/Target/PowerPC/PPC.h
llvm/branches/Apple/Dib/lib/Target/PowerPC/PPCTargetMachine.cpp
llvm/branches/Apple/Dib/lib/Target/PowerPC/PPCTargetMachine.h
llvm/branches/Apple/Dib/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
llvm/branches/Apple/Dib/lib/Target/Sparc/Sparc.h
llvm/branches/Apple/Dib/lib/Target/Sparc/SparcTargetMachine.cpp
llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h
llvm/branches/Apple/Dib/lib/Target/X86/X86.h
llvm/branches/Apple/Dib/lib/Target/X86/X86TargetMachine.cpp
llvm/branches/Apple/Dib/lib/Target/X86/X86TargetMachine.h
llvm/branches/Apple/Dib/lib/Target/XCore/XCore.h
llvm/branches/Apple/Dib/lib/Target/XCore/XCoreAsmPrinter.cpp
llvm/branches/Apple/Dib/lib/Target/XCore/XCoreTargetMachine.cpp
llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp
Modified: llvm/branches/Apple/Dib/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/include/llvm/CodeGen/AsmPrinter.h?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/branches/Apple/Dib/include/llvm/CodeGen/AsmPrinter.h Tue Feb 24 02:33:47 2009
@@ -65,6 +65,8 @@
// Necessary for external weak linkage support
std::set<const GlobalValue*> ExtWeakSymbols;
+ /// Fast - Generating code via fast instruction selection.
+ bool Fast;
public:
/// Output stream on which we're printing assembly code.
///
@@ -82,6 +84,9 @@
///
const TargetRegisterInfo *TRI;
+ /// The current machine function.
+ const MachineFunction *MF;
+
/// Name-mangler for global names.
///
Mangler *Mang;
@@ -101,7 +106,8 @@
bool IsInTextSection;
protected:
- AsmPrinter(raw_ostream &o, TargetMachine &TM, const TargetAsmInfo *T);
+ AsmPrinter(raw_ostream &o, TargetMachine &TM,
+ const TargetAsmInfo *T, bool F);
public:
virtual ~AsmPrinter();
Modified: llvm/branches/Apple/Dib/include/llvm/CodeGen/DwarfWriter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/include/llvm/CodeGen/DwarfWriter.h?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/include/llvm/CodeGen/DwarfWriter.h (original)
+++ llvm/branches/Apple/Dib/include/llvm/CodeGen/DwarfWriter.h Tue Feb 24 02:33:47 2009
@@ -49,9 +49,6 @@
///
DwarfException *DE;
- /// FastCodeGen - True if generating code via the "fast" isel.
- ///
- bool FastCodeGen;
public:
static char ID; // Pass identification, replacement for typeid
@@ -107,9 +104,6 @@
/// ShouldEmitDwarfDebug - Returns true if Dwarf debugging declarations should
/// be emitted.
bool ShouldEmitDwarfDebug() const;
-
- bool getFastCodeGen() const { return FastCodeGen; }
- void setFastCodeGen(bool Fast) { FastCodeGen = Fast; }
};
Modified: llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Tue Feb 24 02:33:47 2009
@@ -37,8 +37,8 @@
char AsmPrinter::ID = 0;
AsmPrinter::AsmPrinter(raw_ostream &o, TargetMachine &tm,
- const TargetAsmInfo *T)
- : MachineFunctionPass(&ID), FunctionNumber(0), O(o),
+ const TargetAsmInfo *T, bool F)
+ : MachineFunctionPass(&ID), FunctionNumber(0), Fast(F), O(o),
TM(tm), TAI(T), TRI(tm.getRegisterInfo()),
IsInTextSection(false)
{}
Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
+++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/FastISel.cpp Tue Feb 24 02:33:47 2009
@@ -370,7 +370,6 @@
unsigned Line = Subprogram.getLineNumber();
unsigned LabelID = DW->RecordSourceLine(Line, 0, SrcFile);
setCurDebugLoc(DebugLoc::get(MF.getOrCreateDebugLocID(SrcFile, Line, 0)));
- DW->setFastCodeGen(true);
if (DW->getRecordSourceLineCount() != 1) {
const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original)
+++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Tue Feb 24 02:33:47 2009
@@ -3918,7 +3918,6 @@
if (Fast)
DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(),
getRoot(), LabelID));
- DW->setFastCodeGen(Fast);
}
return 0;
Modified: llvm/branches/Apple/Dib/lib/Target/ARM/ARM.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/ARM/ARM.h?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/ARM/ARM.h (original)
+++ llvm/branches/Apple/Dib/lib/Target/ARM/ARM.h Tue Feb 24 02:33:47 2009
@@ -89,7 +89,9 @@
}
FunctionPass *createARMISelDag(ARMTargetMachine &TM);
-FunctionPass *createARMCodePrinterPass(raw_ostream &O, ARMTargetMachine &TM);
+FunctionPass *createARMCodePrinterPass(raw_ostream &O,
+ ARMTargetMachine &TM,
+ bool Fast);
FunctionPass *createARMCodeEmitterPass(ARMTargetMachine &TM,
MachineCodeEmitter &MCE);
FunctionPass *createARMLoadStoreOptimizationPass();
Modified: llvm/branches/Apple/Dib/lib/Target/ARM/ARMTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/ARM/ARMTargetMachine.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/ARM/ARMTargetMachine.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/ARM/ARMTargetMachine.cpp Tue Feb 24 02:33:47 2009
@@ -157,7 +157,7 @@
// Output assembly language.
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
if (AsmPrinterCtor)
- PM.add(AsmPrinterCtor(Out, *this));
+ PM.add(AsmPrinterCtor(Out, *this, Fast));
return false;
}
@@ -174,7 +174,7 @@
if (DumpAsm) {
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
if (AsmPrinterCtor)
- PM.add(AsmPrinterCtor(errs(), *this));
+ PM.add(AsmPrinterCtor(errs(), *this, Fast));
}
return false;
@@ -187,7 +187,7 @@
if (DumpAsm) {
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
if (AsmPrinterCtor)
- PM.add(AsmPrinterCtor(errs(), *this));
+ PM.add(AsmPrinterCtor(errs(), *this, Fast));
}
return false;
Modified: llvm/branches/Apple/Dib/lib/Target/ARM/ARMTargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/ARM/ARMTargetMachine.h?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/ARM/ARMTargetMachine.h (original)
+++ llvm/branches/Apple/Dib/lib/Target/ARM/ARMTargetMachine.h Tue Feb 24 02:33:47 2009
@@ -40,7 +40,8 @@
// To avoid having target depend on the asmprinter stuff libraries, asmprinter
// set this functions to ctor pointer at startup time if they are linked in.
typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o,
- ARMTargetMachine &tm);
+ ARMTargetMachine &tm,
+ bool fast);
static AsmPrinterCtorFn AsmPrinterCtor;
public:
Modified: llvm/branches/Apple/Dib/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Tue Feb 24 02:33:47 2009
@@ -42,13 +42,7 @@
STATISTIC(EmittedInsts, "Number of machine instrs printed");
namespace {
- struct VISIBILITY_HIDDEN ARMAsmPrinter : public AsmPrinter {
- ARMAsmPrinter(raw_ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
- : AsmPrinter(O, TM, T), DW(0), MMI(NULL), AFI(NULL), MCP(NULL),
- InCPMode(false) {
- Subtarget = &TM.getSubtarget<ARMSubtarget>();
- }
-
+ class VISIBILITY_HIDDEN ARMAsmPrinter : public AsmPrinter {
DwarfWriter *DW;
MachineModuleInfo *MMI;
@@ -85,7 +79,14 @@
/// True if asm printer is printing a series of CONSTPOOL_ENTRY.
bool InCPMode;
-
+ public:
+ ARMAsmPrinter(raw_ostream &O, TargetMachine &TM,
+ const TargetAsmInfo *T, bool F)
+ : AsmPrinter(O, TM, T, F), DW(0), MMI(NULL), AFI(NULL), MCP(NULL),
+ InCPMode(false) {
+ Subtarget = &TM.getSubtarget<ARMSubtarget>();
+ }
+
virtual const char *getPassName() const {
return "ARM Assembly Printer";
}
@@ -183,6 +184,8 @@
/// method to print assembly for each instruction.
///
bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+ this->MF = &MF;
+
AFI = MF.getInfo<ARMFunctionInfo>();
MCP = MF.getConstantPool();
@@ -1039,8 +1042,9 @@
/// regardless of whether the function is in SSA form.
///
FunctionPass *llvm::createARMCodePrinterPass(raw_ostream &o,
- ARMTargetMachine &tm) {
- return new ARMAsmPrinter(o, tm, tm.getTargetAsmInfo());
+ ARMTargetMachine &tm,
+ bool fast) {
+ return new ARMAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
}
namespace {
Modified: llvm/branches/Apple/Dib/lib/Target/Alpha/Alpha.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/Alpha/Alpha.h?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/Alpha/Alpha.h (original)
+++ llvm/branches/Apple/Dib/lib/Target/Alpha/Alpha.h Tue Feb 24 02:33:47 2009
@@ -25,7 +25,8 @@
FunctionPass *createAlphaISelDag(AlphaTargetMachine &TM);
FunctionPass *createAlphaCodePrinterPass(raw_ostream &OS,
- TargetMachine &TM);
+ TargetMachine &TM,
+ bool Fast);
FunctionPass *createAlphaPatternInstructionSelector(TargetMachine &TM);
FunctionPass *createAlphaCodeEmitterPass(AlphaTargetMachine &TM,
MachineCodeEmitter &MCE);
Modified: llvm/branches/Apple/Dib/lib/Target/Alpha/AlphaTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/Alpha/AlphaTargetMachine.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/Alpha/AlphaTargetMachine.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/Alpha/AlphaTargetMachine.cpp Tue Feb 24 02:33:47 2009
@@ -88,14 +88,14 @@
bool AlphaTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast,
raw_ostream &Out) {
PM.add(createAlphaLLRPPass(*this));
- PM.add(createAlphaCodePrinterPass(Out, *this));
+ PM.add(createAlphaCodePrinterPass(Out, *this, Fast));
return false;
}
bool AlphaTargetMachine::addCodeEmitter(PassManagerBase &PM, bool Fast,
bool DumpAsm, MachineCodeEmitter &MCE) {
PM.add(createAlphaCodeEmitterPass(*this, MCE));
if (DumpAsm)
- PM.add(createAlphaCodePrinterPass(errs(), *this));
+ PM.add(createAlphaCodePrinterPass(errs(), *this, Fast));
return false;
}
bool AlphaTargetMachine::addSimpleCodeEmitter(PassManagerBase &PM,
Modified: llvm/branches/Apple/Dib/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp Tue Feb 24 02:33:47 2009
@@ -33,13 +33,12 @@
namespace {
struct VISIBILITY_HIDDEN AlphaAsmPrinter : public AsmPrinter {
-
/// Unique incrementer for label values for referencing Global values.
///
- AlphaAsmPrinter(raw_ostream &o, TargetMachine &tm, const TargetAsmInfo *T)
- : AsmPrinter(o, tm, T) {
- }
+ AlphaAsmPrinter(raw_ostream &o, TargetMachine &tm,
+ const TargetAsmInfo *T, bool F)
+ : AsmPrinter(o, tm, T, F) {}
virtual const char *getPassName() const {
return "Alpha Assembly Printer";
@@ -68,8 +67,9 @@
/// regardless of whether the function is in SSA form.
///
FunctionPass *llvm::createAlphaCodePrinterPass(raw_ostream &o,
- TargetMachine &tm) {
- return new AlphaAsmPrinter(o, tm, tm.getTargetAsmInfo());
+ TargetMachine &tm,
+ bool fast) {
+ return new AlphaAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
}
#include "AlphaGenAsmWriter.inc"
@@ -139,6 +139,8 @@
/// method to print assembly for each instruction.
///
bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+ this->MF = &MF;
+
SetupMachineFunction(MF);
O << "\n\n";
Modified: llvm/branches/Apple/Dib/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp Tue Feb 24 02:33:47 2009
@@ -45,13 +45,12 @@
const std::string bss_section(".bss");
- struct VISIBILITY_HIDDEN SPUAsmPrinter : public AsmPrinter {
+ class VISIBILITY_HIDDEN SPUAsmPrinter : public AsmPrinter {
std::set<std::string> FnStubs, GVStubs;
-
- SPUAsmPrinter(raw_ostream &O, TargetMachine &TM, const TargetAsmInfo *T) :
- AsmPrinter(O, TM, T)
- {
- }
+ public:
+ SPUAsmPrinter(raw_ostream &O, TargetMachine &TM,
+ const TargetAsmInfo *T, bool F) :
+ AsmPrinter(O, TM, T, F) {}
virtual const char *getPassName() const {
return "STI CBEA SPU Assembly Printer";
@@ -285,17 +284,13 @@
};
/// LinuxAsmPrinter - SPU assembly printer, customized for Linux
- struct VISIBILITY_HIDDEN LinuxAsmPrinter : public SPUAsmPrinter {
-
+ class VISIBILITY_HIDDEN LinuxAsmPrinter : public SPUAsmPrinter {
DwarfWriter *DW;
MachineModuleInfo *MMI;
-
+ public:
LinuxAsmPrinter(raw_ostream &O, SPUTargetMachine &TM,
- const TargetAsmInfo *T) :
- SPUAsmPrinter(O, TM, T),
- DW(0),
- MMI(0)
- { }
+ const TargetAsmInfo *T, bool F)
+ : SPUAsmPrinter(O, TM, T, F), DW(0), MMI(0) {}
virtual const char *getPassName() const {
return "STI CBEA SPU Assembly Printer";
@@ -427,6 +422,8 @@
bool
LinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF)
{
+ this->MF = &MF;
+
SetupMachineFunction(MF);
O << "\n\n";
@@ -613,6 +610,7 @@
/// that the Linux SPU assembler can deal with.
///
FunctionPass *llvm::createSPUAsmPrinterPass(raw_ostream &o,
- SPUTargetMachine &tm) {
- return new LinuxAsmPrinter(o, tm, tm.getTargetAsmInfo());
+ SPUTargetMachine &tm,
+ bool fast) {
+ return new LinuxAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
}
Modified: llvm/branches/Apple/Dib/lib/Target/CellSPU/SPU.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/CellSPU/SPU.h?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/CellSPU/SPU.h (original)
+++ llvm/branches/Apple/Dib/lib/Target/CellSPU/SPU.h Tue Feb 24 02:33:47 2009
@@ -23,7 +23,9 @@
class raw_ostream;
FunctionPass *createSPUISelDag(SPUTargetMachine &TM);
- FunctionPass *createSPUAsmPrinterPass(raw_ostream &o, SPUTargetMachine &tm);
+ FunctionPass *createSPUAsmPrinterPass(raw_ostream &o,
+ SPUTargetMachine &tm,
+ bool fast);
/*--== Utility functions/predicates/etc used all over the place: --==*/
//! Predicate test for a signed 10-bit value
Modified: llvm/branches/Apple/Dib/lib/Target/CellSPU/SPUTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/CellSPU/SPUTargetMachine.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/CellSPU/SPUTargetMachine.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/CellSPU/SPUTargetMachine.cpp Tue Feb 24 02:33:47 2009
@@ -90,6 +90,6 @@
bool SPUTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast,
raw_ostream &Out) {
- PM.add(createSPUAsmPrinterPass(Out, *this));
+ PM.add(createSPUAsmPrinterPass(Out, *this, Fast));
return false;
}
Modified: llvm/branches/Apple/Dib/lib/Target/IA64/IA64.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/IA64/IA64.h?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/IA64/IA64.h (original)
+++ llvm/branches/Apple/Dib/lib/Target/IA64/IA64.h Tue Feb 24 02:33:47 2009
@@ -35,7 +35,9 @@
/// 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
Modified: llvm/branches/Apple/Dib/lib/Target/IA64/IA64AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/IA64/IA64AsmPrinter.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/IA64/IA64AsmPrinter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/IA64/IA64AsmPrinter.cpp Tue Feb 24 02:33:47 2009
@@ -34,12 +34,12 @@
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 @@
/// method to print assembly for each instruction.
///
bool IA64AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+ this->MF = &MF;
+
SetupMachineFunction(MF);
O << "\n\n";
@@ -365,6 +367,7 @@
/// 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);
}
Modified: llvm/branches/Apple/Dib/lib/Target/IA64/IA64TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/IA64/IA64TargetMachine.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/IA64/IA64TargetMachine.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/IA64/IA64TargetMachine.cpp Tue Feb 24 02:33:47 2009
@@ -84,7 +84,7 @@
}
bool IA64TargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast,
raw_ostream &Out) {
- PM.add(createIA64CodePrinterPass(Out, *this));
+ PM.add(createIA64CodePrinterPass(Out, *this, Fast));
return false;
}
Modified: llvm/branches/Apple/Dib/lib/Target/Mips/Mips.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/Mips/Mips.h?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/Mips/Mips.h (original)
+++ llvm/branches/Apple/Dib/lib/Target/Mips/Mips.h Tue Feb 24 02:33:47 2009
@@ -24,7 +24,8 @@
FunctionPass *createMipsISelDag(MipsTargetMachine &TM);
FunctionPass *createMipsDelaySlotFillerPass(MipsTargetMachine &TM);
FunctionPass *createMipsCodePrinterPass(raw_ostream &OS,
- MipsTargetMachine &TM);
+ MipsTargetMachine &TM,
+ bool Fast);
} // end namespace llvm;
// Defines symbolic names for Mips registers. This defines a mapping from
Modified: llvm/branches/Apple/Dib/lib/Target/Mips/MipsAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/Mips/MipsAsmPrinter.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/Mips/MipsAsmPrinter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/Mips/MipsAsmPrinter.cpp Tue Feb 24 02:33:47 2009
@@ -46,13 +46,12 @@
STATISTIC(EmittedInsts, "Number of machine instrs printed");
namespace {
- struct VISIBILITY_HIDDEN MipsAsmPrinter : public AsmPrinter {
-
+ class VISIBILITY_HIDDEN MipsAsmPrinter : public AsmPrinter {
const MipsSubtarget *Subtarget;
-
+ public:
MipsAsmPrinter(raw_ostream &O, MipsTargetMachine &TM,
- const TargetAsmInfo *T):
- AsmPrinter(O, TM, T) {
+ const TargetAsmInfo *T, bool F)
+ : AsmPrinter(O, TM, T, F) {
Subtarget = &TM.getSubtarget<MipsSubtarget>();
}
@@ -91,9 +90,9 @@
/// using the given target machine description. This should work
/// regardless of whether the function is in SSA form.
FunctionPass *llvm::createMipsCodePrinterPass(raw_ostream &o,
- MipsTargetMachine &tm)
-{
- return new MipsAsmPrinter(o, tm, tm.getTargetAsmInfo());
+ MipsTargetMachine &tm,
+ bool fast) {
+ return new MipsAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
}
//===----------------------------------------------------------------------===//
@@ -266,6 +265,8 @@
bool MipsAsmPrinter::
runOnMachineFunction(MachineFunction &MF)
{
+ this->MF = &MF;
+
SetupMachineFunction(MF);
// Print out constants referenced by the function
Modified: llvm/branches/Apple/Dib/lib/Target/Mips/MipsTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/Mips/MipsTargetMachine.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/Mips/MipsTargetMachine.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/Mips/MipsTargetMachine.cpp Tue Feb 24 02:33:47 2009
@@ -128,6 +128,6 @@
raw_ostream &Out)
{
// Output assembly language.
- PM.add(createMipsCodePrinterPass(Out, *this));
+ PM.add(createMipsCodePrinterPass(Out, *this, Fast));
return false;
}
Modified: llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16.h?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16.h (original)
+++ llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16.h Tue Feb 24 02:33:47 2009
@@ -74,7 +74,8 @@
FunctionPass *createPIC16ISelDag(PIC16TargetMachine &TM);
FunctionPass *createPIC16CodePrinterPass(raw_ostream &OS,
- PIC16TargetMachine &TM);
+ PIC16TargetMachine &TM,
+ bool Fast);
} // end namespace llvm;
// Defines symbolic names for PIC16 registers. This defines a mapping from
Modified: llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16AsmPrinter.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16AsmPrinter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16AsmPrinter.cpp Tue Feb 24 02:33:47 2009
@@ -90,6 +90,8 @@
/// method to print assembly for each instruction.
///
bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+ this->MF = &MF;
+
// This calls the base class function required to be called at beginning
// of runOnMachineFunction.
SetupMachineFunction(MF);
@@ -133,8 +135,9 @@
/// regardless of whether the function is in SSA form.
///
FunctionPass *llvm::createPIC16CodePrinterPass(raw_ostream &o,
- PIC16TargetMachine &tm) {
- return new PIC16AsmPrinter(o, tm, tm.getTargetAsmInfo());
+ PIC16TargetMachine &tm,
+ bool fast) {
+ return new PIC16AsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
}
void PIC16AsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
Modified: llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16AsmPrinter.h?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16AsmPrinter.h (original)
+++ llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16AsmPrinter.h Tue Feb 24 02:33:47 2009
@@ -24,8 +24,9 @@
namespace llvm {
struct VISIBILITY_HIDDEN PIC16AsmPrinter : public AsmPrinter {
- PIC16AsmPrinter(raw_ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
- : AsmPrinter(O, TM, T) {
+ PIC16AsmPrinter(raw_ostream &O, TargetMachine &TM,
+ const TargetAsmInfo *T, bool F)
+ : AsmPrinter(O, TM, T, F) {
CurrentBankselLabelInBasicBlock = "";
IsRomData = false;
}
Modified: llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16TargetMachine.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16TargetMachine.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16TargetMachine.cpp Tue Feb 24 02:33:47 2009
@@ -64,7 +64,7 @@
bool PIC16TargetMachine::
addAssemblyEmitter(PassManagerBase &PM, bool Fast, raw_ostream &Out) {
// Output assembly language.
- PM.add(createPIC16CodePrinterPass(Out, *this));
+ PM.add(createPIC16CodePrinterPass(Out, *this, Fast));
return false;
}
Modified: llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Tue Feb 24 02:33:47 2009
@@ -49,13 +49,15 @@
STATISTIC(EmittedInsts, "Number of machine instrs printed");
namespace {
- struct VISIBILITY_HIDDEN PPCAsmPrinter : public AsmPrinter {
+ class VISIBILITY_HIDDEN PPCAsmPrinter : public AsmPrinter {
+ protected:
StringSet<> FnStubs, GVStubs, HiddenGVStubs;
const PPCSubtarget &Subtarget;
-
- PPCAsmPrinter(raw_ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
- : AsmPrinter(O, TM, T), Subtarget(TM.getSubtarget<PPCSubtarget>()) {
- }
+ public:
+ PPCAsmPrinter(raw_ostream &O, TargetMachine &TM,
+ const TargetAsmInfo *T, bool F)
+ : AsmPrinter(O, TM, T, F),
+ Subtarget(TM.getSubtarget<PPCSubtarget>()) {}
virtual const char *getPassName() const {
return "PowerPC Assembly Printer";
@@ -291,14 +293,13 @@
};
/// PPCLinuxAsmPrinter - PowerPC assembly printer, customized for Linux
- struct VISIBILITY_HIDDEN PPCLinuxAsmPrinter : public PPCAsmPrinter {
+ class VISIBILITY_HIDDEN PPCLinuxAsmPrinter : public PPCAsmPrinter {
DwarfWriter *DW;
MachineModuleInfo *MMI;
-
+ public:
PPCLinuxAsmPrinter(raw_ostream &O, PPCTargetMachine &TM,
- const TargetAsmInfo *T)
- : PPCAsmPrinter(O, TM, T), DW(0), MMI(0) {
- }
+ const TargetAsmInfo *T, bool F)
+ : PPCAsmPrinter(O, TM, T, F), DW(0), MMI(0) {}
virtual const char *getPassName() const {
return "Linux PPC Assembly Printer";
@@ -320,15 +321,14 @@
/// PPCDarwinAsmPrinter - PowerPC assembly printer, customized for Darwin/Mac
/// OS X
- struct VISIBILITY_HIDDEN PPCDarwinAsmPrinter : public PPCAsmPrinter {
-
+ class VISIBILITY_HIDDEN PPCDarwinAsmPrinter : public PPCAsmPrinter {
DwarfWriter *DW;
MachineModuleInfo *MMI;
raw_ostream &OS;
+ public:
PPCDarwinAsmPrinter(raw_ostream &O, PPCTargetMachine &TM,
- const TargetAsmInfo *T)
- : PPCAsmPrinter(O, TM, T), DW(0), MMI(0), OS(O) {
- }
+ const TargetAsmInfo *T, bool F)
+ : PPCAsmPrinter(O, TM, T, F), DW(0), MMI(0), OS(O) {}
virtual const char *getPassName() const {
return "Darwin PPC Assembly Printer";
@@ -571,6 +571,7 @@
/// method to print assembly for each instruction.
///
bool PPCLinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+ this->MF = &MF;
SetupMachineFunction(MF);
O << "\n\n";
@@ -764,6 +765,8 @@
/// method to print assembly for each instruction.
///
bool PPCDarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+ this->MF = &MF;
+
SetupMachineFunction(MF);
O << "\n\n";
@@ -1146,13 +1149,14 @@
/// Darwin assembler can deal with.
///
FunctionPass *llvm::createPPCAsmPrinterPass(raw_ostream &o,
- PPCTargetMachine &tm) {
+ PPCTargetMachine &tm,
+ bool fast) {
const PPCSubtarget *Subtarget = &tm.getSubtarget<PPCSubtarget>();
if (Subtarget->isDarwin()) {
- return new PPCDarwinAsmPrinter(o, tm, tm.getTargetAsmInfo());
+ return new PPCDarwinAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
} else {
- return new PPCLinuxAsmPrinter(o, tm, tm.getTargetAsmInfo());
+ return new PPCLinuxAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
}
}
Modified: llvm/branches/Apple/Dib/lib/Target/PowerPC/PPC.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/PowerPC/PPC.h?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/PowerPC/PPC.h (original)
+++ llvm/branches/Apple/Dib/lib/Target/PowerPC/PPC.h Tue Feb 24 02:33:47 2009
@@ -27,7 +27,8 @@
FunctionPass *createPPCBranchSelectionPass();
FunctionPass *createPPCISelDag(PPCTargetMachine &TM);
FunctionPass *createPPCAsmPrinterPass(raw_ostream &OS,
- PPCTargetMachine &TM);
+ PPCTargetMachine &TM,
+ bool Fast);
FunctionPass *createPPCCodeEmitterPass(PPCTargetMachine &TM,
MachineCodeEmitter &MCE);
} // end namespace llvm;
Modified: llvm/branches/Apple/Dib/lib/Target/PowerPC/PPCTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/PowerPC/PPCTargetMachine.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/PowerPC/PPCTargetMachine.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/PowerPC/PPCTargetMachine.cpp Tue Feb 24 02:33:47 2009
@@ -146,7 +146,7 @@
raw_ostream &Out) {
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
if (AsmPrinterCtor)
- PM.add(AsmPrinterCtor(Out, *this));
+ PM.add(AsmPrinterCtor(Out, *this, Fast));
return false;
}
@@ -176,7 +176,7 @@
if (DumpAsm) {
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
if (AsmPrinterCtor)
- PM.add(AsmPrinterCtor(errs(), *this));
+ PM.add(AsmPrinterCtor(errs(), *this, Fast));
}
return false;
@@ -189,7 +189,7 @@
if (DumpAsm) {
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
if (AsmPrinterCtor)
- PM.add(AsmPrinterCtor(errs(), *this));
+ PM.add(AsmPrinterCtor(errs(), *this, Fast));
}
return false;
Modified: llvm/branches/Apple/Dib/lib/Target/PowerPC/PPCTargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/PowerPC/PPCTargetMachine.h?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/PowerPC/PPCTargetMachine.h (original)
+++ llvm/branches/Apple/Dib/lib/Target/PowerPC/PPCTargetMachine.h Tue Feb 24 02:33:47 2009
@@ -45,7 +45,8 @@
// To avoid having target depend on the asmprinter stuff libraries, asmprinter
// set this functions to ctor pointer at startup time if they are linked in.
typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o,
- PPCTargetMachine &tm);
+ PPCTargetMachine &tm,
+ bool fast);
static AsmPrinterCtorFn AsmPrinterCtor;
public:
Modified: llvm/branches/Apple/Dib/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp Tue Feb 24 02:33:47 2009
@@ -40,17 +40,17 @@
STATISTIC(EmittedInsts, "Number of machine instrs printed");
namespace {
- struct VISIBILITY_HIDDEN SparcAsmPrinter : public AsmPrinter {
- SparcAsmPrinter(raw_ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
- : AsmPrinter(O, TM, T) {
- }
-
+ class VISIBILITY_HIDDEN SparcAsmPrinter : public AsmPrinter {
/// We name each basic block in a Function with a unique number, so
/// that we can consistently refer to them later. This is cleared
/// at the beginning of each call to runOnMachineFunction().
///
typedef std::map<const Value *, unsigned> ValueMapTy;
ValueMapTy NumberForBB;
+ public:
+ SparcAsmPrinter(raw_ostream &O, TargetMachine &TM,
+ const TargetAsmInfo *T, bool F)
+ : AsmPrinter(O, TM, T, F) {}
virtual const char *getPassName() const {
return "Sparc Assembly Printer";
@@ -81,14 +81,17 @@
/// regardless of whether the function is in SSA form.
///
FunctionPass *llvm::createSparcCodePrinterPass(raw_ostream &o,
- TargetMachine &tm) {
- return new SparcAsmPrinter(o, tm, tm.getTargetAsmInfo());
+ TargetMachine &tm,
+ bool fast) {
+ return new SparcAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
}
/// runOnMachineFunction - This uses the printInstruction()
/// method to print assembly for each instruction.
///
bool SparcAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+ this->MF = &MF;
+
SetupMachineFunction(MF);
// Print out constants referenced by the function
Modified: llvm/branches/Apple/Dib/lib/Target/Sparc/Sparc.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/Sparc/Sparc.h?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/Sparc/Sparc.h (original)
+++ llvm/branches/Apple/Dib/lib/Target/Sparc/Sparc.h Tue Feb 24 02:33:47 2009
@@ -24,7 +24,8 @@
class raw_ostream;
FunctionPass *createSparcISelDag(SparcTargetMachine &TM);
- FunctionPass *createSparcCodePrinterPass(raw_ostream &OS, TargetMachine &TM);
+ FunctionPass *createSparcCodePrinterPass(raw_ostream &OS,
+ TargetMachine &TM, bool Fast);
FunctionPass *createSparcDelaySlotFillerPass(TargetMachine &TM);
FunctionPass *createSparcFPMoverPass(TargetMachine &TM);
} // end namespace llvm;
Modified: llvm/branches/Apple/Dib/lib/Target/Sparc/SparcTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/Sparc/SparcTargetMachine.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/Sparc/SparcTargetMachine.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/Sparc/SparcTargetMachine.cpp Tue Feb 24 02:33:47 2009
@@ -85,6 +85,6 @@
bool SparcTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast,
raw_ostream &Out) {
// Output assembly language.
- PM.add(createSparcCodePrinterPass(Out, *this));
+ PM.add(createSparcCodePrinterPass(Out, *this, Fast));
return false;
}
Modified: llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h (original)
+++ llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h Tue Feb 24 02:33:47 2009
@@ -28,15 +28,14 @@
struct MachineJumpTableInfo;
-struct VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter {
- MachineFunction *MF;
+class VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter {
DwarfWriter *DW;
MachineModuleInfo *MMI;
const X86Subtarget *Subtarget;
-
+ public:
X86ATTAsmPrinter(raw_ostream &O, X86TargetMachine &TM,
- const TargetAsmInfo *T)
- : AsmPrinter(O, TM, T), DW(0), MMI(0) {
+ const TargetAsmInfo *T, bool F)
+ : AsmPrinter(O, TM, T, F), DW(0), MMI(0) {
Subtarget = &TM.getSubtarget<X86Subtarget>();
}
Modified: llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp Tue Feb 24 02:33:47 2009
@@ -24,13 +24,14 @@
/// machine description.
///
FunctionPass *llvm::createX86CodePrinterPass(raw_ostream &o,
- X86TargetMachine &tm) {
+ X86TargetMachine &tm,
+ bool fast) {
const X86Subtarget *Subtarget = &tm.getSubtarget<X86Subtarget>();
if (Subtarget->isFlavorIntel()) {
- return new X86IntelAsmPrinter(o, tm, tm.getTargetAsmInfo());
+ return new X86IntelAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
} else {
- return new X86ATTAsmPrinter(o, tm, tm.getTargetAsmInfo());
+ return new X86ATTAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
}
}
Modified: llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp Tue Feb 24 02:33:47 2009
@@ -122,6 +122,7 @@
/// method to print assembly for each instruction.
///
bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+ this->MF = &MF;
SetupMachineFunction(MF);
O << "\n\n";
Modified: llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h (original)
+++ llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h Tue Feb 24 02:33:47 2009
@@ -26,9 +26,8 @@
struct VISIBILITY_HIDDEN X86IntelAsmPrinter : public AsmPrinter {
X86IntelAsmPrinter(raw_ostream &O, X86TargetMachine &TM,
- const TargetAsmInfo *T)
- : AsmPrinter(O, TM, T) {
- }
+ const TargetAsmInfo *T, bool F)
+ : AsmPrinter(O, TM, T, F) {}
virtual const char *getPassName() const {
return "X86 Intel-Style Assembly Printer";
Modified: llvm/branches/Apple/Dib/lib/Target/X86/X86.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/X86.h?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/X86/X86.h (original)
+++ llvm/branches/Apple/Dib/lib/Target/X86/X86.h Tue Feb 24 02:33:47 2009
@@ -42,7 +42,9 @@
/// assembly code for a MachineFunction to the given output stream,
/// using the given target machine description.
///
-FunctionPass *createX86CodePrinterPass(raw_ostream &o, X86TargetMachine &tm);
+FunctionPass *createX86CodePrinterPass(raw_ostream &o,
+ X86TargetMachine &tm,
+ bool fast);
/// createX86CodeEmitterPass - Return a pass that emits the collected X86 code
/// to the specified MCE object.
Modified: llvm/branches/Apple/Dib/lib/Target/X86/X86TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/X86TargetMachine.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/X86/X86TargetMachine.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/X86/X86TargetMachine.cpp Tue Feb 24 02:33:47 2009
@@ -210,7 +210,7 @@
raw_ostream &Out) {
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
if (AsmPrinterCtor)
- PM.add(AsmPrinterCtor(Out, *this));
+ PM.add(AsmPrinterCtor(Out, *this, Fast));
return false;
}
@@ -236,7 +236,7 @@
if (DumpAsm) {
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
if (AsmPrinterCtor)
- PM.add(AsmPrinterCtor(errs(), *this));
+ PM.add(AsmPrinterCtor(errs(), *this, Fast));
}
return false;
@@ -248,7 +248,7 @@
if (DumpAsm) {
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
if (AsmPrinterCtor)
- PM.add(AsmPrinterCtor(errs(), *this));
+ PM.add(AsmPrinterCtor(errs(), *this, Fast));
}
return false;
Modified: llvm/branches/Apple/Dib/lib/Target/X86/X86TargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/X86TargetMachine.h?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/X86/X86TargetMachine.h (original)
+++ llvm/branches/Apple/Dib/lib/Target/X86/X86TargetMachine.h Tue Feb 24 02:33:47 2009
@@ -44,7 +44,8 @@
// To avoid having target depend on the asmprinter stuff libraries, asmprinter
// set this functions to ctor pointer at startup time if they are linked in.
typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o,
- X86TargetMachine &tm);
+ X86TargetMachine &tm,
+ bool fast);
static AsmPrinterCtorFn AsmPrinterCtor;
public:
Modified: llvm/branches/Apple/Dib/lib/Target/XCore/XCore.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/XCore/XCore.h?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/XCore/XCore.h (original)
+++ llvm/branches/Apple/Dib/lib/Target/XCore/XCore.h Tue Feb 24 02:33:47 2009
@@ -23,7 +23,8 @@
FunctionPass *createXCoreISelDag(XCoreTargetMachine &TM);
FunctionPass *createXCoreCodePrinterPass(raw_ostream &OS,
- XCoreTargetMachine &TM);
+ XCoreTargetMachine &TM,
+ bool Fast);
} // end namespace llvm;
// Defines symbolic names for XCore registers. This defines a mapping from
Modified: llvm/branches/Apple/Dib/lib/Target/XCore/XCoreAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/XCore/XCoreAsmPrinter.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/XCore/XCoreAsmPrinter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/XCore/XCoreAsmPrinter.cpp Tue Feb 24 02:33:47 2009
@@ -53,14 +53,14 @@
cl::init(8));
namespace {
- struct VISIBILITY_HIDDEN XCoreAsmPrinter : public AsmPrinter {
- XCoreAsmPrinter(raw_ostream &O, XCoreTargetMachine &TM,
- const TargetAsmInfo *T)
- : AsmPrinter(O, TM, T), DW(0),
- Subtarget(*TM.getSubtargetImpl()) { }
-
+ class VISIBILITY_HIDDEN XCoreAsmPrinter : public AsmPrinter {
DwarfWriter *DW;
const XCoreSubtarget &Subtarget;
+ public:
+ XCoreAsmPrinter(raw_ostream &O, XCoreTargetMachine &TM,
+ const TargetAsmInfo *T, bool F)
+ : AsmPrinter(O, TM, T, F), DW(0),
+ Subtarget(*TM.getSubtargetImpl()) {}
virtual const char *getPassName() const {
return "XCore Assembly Printer";
@@ -104,8 +104,9 @@
/// regardless of whether the function is in SSA form.
///
FunctionPass *llvm::createXCoreCodePrinterPass(raw_ostream &o,
- XCoreTargetMachine &tm) {
- return new XCoreAsmPrinter(o, tm, tm.getTargetAsmInfo());
+ XCoreTargetMachine &tm,
+ bool fast) {
+ return new XCoreAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
}
// PrintEscapedString - Print each character of the specified string, escaping
@@ -293,6 +294,8 @@
///
bool XCoreAsmPrinter::runOnMachineFunction(MachineFunction &MF)
{
+ this->MF = &MF;
+
SetupMachineFunction(MF);
// Print out constants referenced by the function
Modified: llvm/branches/Apple/Dib/lib/Target/XCore/XCoreTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/XCore/XCoreTargetMachine.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/XCore/XCoreTargetMachine.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/XCore/XCoreTargetMachine.cpp Tue Feb 24 02:33:47 2009
@@ -63,6 +63,6 @@
bool XCoreTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast,
raw_ostream &Out) {
// Output assembly language.
- PM.add(createXCoreCodePrinterPass(Out, *this));
+ PM.add(createXCoreCodePrinterPass(Out, *this, Fast));
return false;
}
Modified: llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp?rev=65380&r1=65379&r2=65380&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp (original)
+++ llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp Tue Feb 24 02:33:47 2009
@@ -641,9 +641,7 @@
O << "\";\n\n";
O << " if (TAI->doesSupportDebugInformation() &&\n"
- << " DW->ShouldEmitDwarfDebug() &&\n"
- << " !DW->getFastCodeGen()) {\n"
- << " const MachineFunction *MF = MI->getParent()->getParent();\n"
+ << " DW->ShouldEmitDwarfDebug() && !Fast) {\n"
<< " DebugLoc CurDL = MI->getDebugLoc();\n\n"
<< " if (!CurDL.isUnknown()) {\n"
<< " static DebugLocTuple PrevDLT(~0U, ~0U, ~0U);\n"
More information about the llvm-commits
mailing list