llvm.org GIT mirror llvm / 5bcc8bd
Remove unused AsmPrinter OptLevel argument, and propogate. - This more or less amounts to a revert of r65379. I'm curious to know what happened that caused this variable to become unused. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74579 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 11 years ago
46 changed file(s) with 98 addition(s) and 148 deletion(s). Raw diff Collapse all Expand all
6464 /// DW - If available, this is a pointer to the current dwarf writer.
6565 DwarfWriter *DW;
6666
67 /// OptLevel - Generating code at a specific optimization level.
68 CodeGenOpt::Level OptLevel;
6967 public:
7068 /// Output stream on which we're printing assembly code.
7169 ///
119117
120118 protected:
121119 explicit AsmPrinter(raw_ostream &o, TargetMachine &TM,
122 const TargetAsmInfo *T, CodeGenOpt::Level OL, bool V);
120 const TargetAsmInfo *T, bool V);
123121
124122 public:
125123 virtual ~AsmPrinter();
138136 ///
139137 /// This method is used when about to emit executable code.
140138 ///
141 void SwitchToTextSection(const char *NewSection, const GlobalValue *GV = NULL);
139 void SwitchToTextSection(const char *NewSection,
140 const GlobalValue *GV = NULL);
142141
143142 /// SwitchToDataSection - Switch to the specified section of the executable
144143 /// if we are not already in it! If GV is non-null and if the global has an
152151 /// is the same as the SwitchToTextSection method, but not all assemblers
153152 /// are the same.
154153 ///
155 void SwitchToDataSection(const char *NewSection, const GlobalValue *GV = NULL);
154 void SwitchToDataSection(const char *NewSection,
155 const GlobalValue *GV = NULL);
156156
157157 /// SwitchToSection - Switch to the specified section of the executable if
158158 /// we are not already in it!
4141
4242 char AsmPrinter::ID = 0;
4343 AsmPrinter::AsmPrinter(raw_ostream &o, TargetMachine &tm,
44 const TargetAsmInfo *T, CodeGenOpt::Level OL, bool VDef)
45 : MachineFunctionPass(&ID), FunctionNumber(0), OptLevel(OL), O(o),
44 const TargetAsmInfo *T, bool VDef)
45 : MachineFunctionPass(&ID), FunctionNumber(0), O(o),
4646 TM(tm), TAI(T), TRI(tm.getRegisterInfo()),
4747 IsInTextSection(false), LastMI(0), LastFn(0), Counter(~0U),
4848 PrevDLT(0, ~0U, ~0U) {
9292 FunctionPass *createARMISelDag(ARMBaseTargetMachine &TM);
9393 FunctionPass *createARMCodePrinterPass(raw_ostream &O,
9494 ARMBaseTargetMachine &TM,
95 CodeGenOpt::Level OptLevel,
9695 bool Verbose);
9796 FunctionPass *createARMCodeEmitterPass(ARMBaseTargetMachine &TM,
9897 MachineCodeEmitter &MCE);
178178 // Output assembly language.
179179 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
180180 if (AsmPrinterCtor)
181 PM.add(AsmPrinterCtor(Out, *this, OptLevel, Verbose));
181 PM.add(AsmPrinterCtor(Out, *this, Verbose));
182182
183183 return false;
184184 }
197197 if (DumpAsm) {
198198 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
199199 if (AsmPrinterCtor)
200 PM.add(AsmPrinterCtor(errs(), *this, OptLevel, true));
200 PM.add(AsmPrinterCtor(errs(), *this, true));
201201 }
202202
203203 return false;
216216 if (DumpAsm) {
217217 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
218218 if (AsmPrinterCtor)
219 PM.add(AsmPrinterCtor(errs(), *this, OptLevel, true));
219 PM.add(AsmPrinterCtor(errs(), *this, true));
220220 }
221221
222222 return false;
231231 if (DumpAsm) {
232232 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
233233 if (AsmPrinterCtor)
234 PM.add(AsmPrinterCtor(errs(), *this, OptLevel, true));
234 PM.add(AsmPrinterCtor(errs(), *this, true));
235235 }
236236
237237 return false;
246246 if (DumpAsm) {
247247 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
248248 if (AsmPrinterCtor)
249 PM.add(AsmPrinterCtor(errs(), *this, OptLevel, true));
250 }
251
252 return false;
253 }
254
255
249 PM.add(AsmPrinterCtor(errs(), *this, true));
250 }
251
252 return false;
253 }
254
255
4242 // set this functions to ctor pointer at startup time if they are linked in.
4343 typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o,
4444 ARMBaseTargetMachine &tm,
45 CodeGenOpt::Level OptLevel,
4645 bool verbose);
4746 static AsmPrinterCtorFn AsmPrinterCtor;
4847
8181 bool InCPMode;
8282 public:
8383 explicit ARMAsmPrinter(raw_ostream &O, TargetMachine &TM,
84 const TargetAsmInfo *T, CodeGenOpt::Level OL,
85 bool V)
86 : AsmPrinter(O, TM, T, OL, V), DW(0), AFI(NULL), MCP(NULL),
84 const TargetAsmInfo *T, bool V)
85 : AsmPrinter(O, TM, T, V), DW(0), AFI(NULL), MCP(NULL),
8786 InCPMode(false) {
8887 Subtarget = &TM.getSubtarget();
8988 }
11971196 ///
11981197 FunctionPass *llvm::createARMCodePrinterPass(raw_ostream &o,
11991198 ARMBaseTargetMachine &tm,
1200 CodeGenOpt::Level OptLevel,
12011199 bool verbose) {
1202 return new ARMAsmPrinter(o, tm, tm.getTargetAsmInfo(), OptLevel, verbose);
1200 return new ARMAsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
12031201 }
12041202
12051203 namespace {
2626 FunctionPass *createAlphaISelDag(AlphaTargetMachine &TM);
2727 FunctionPass *createAlphaCodePrinterPass(raw_ostream &OS,
2828 TargetMachine &TM,
29 CodeGenOpt::Level OptLevel,
3029 bool Verbose);
3130 FunctionPass *createAlphaPatternInstructionSelector(TargetMachine &TM);
3231 FunctionPass *createAlphaCodeEmitterPass(AlphaTargetMachine &TM,
9393 // Output assembly language.
9494 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
9595 if (AsmPrinterCtor)
96 PM.add(AsmPrinterCtor(Out, *this, OptLevel, Verbose));
96 PM.add(AsmPrinterCtor(Out, *this, Verbose));
9797 return false;
9898 }
9999 bool AlphaTargetMachine::addCodeEmitter(PassManagerBase &PM,
103103 if (DumpAsm) {
104104 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
105105 if (AsmPrinterCtor)
106 PM.add(AsmPrinterCtor(errs(), *this, OptLevel, true));
106 PM.add(AsmPrinterCtor(errs(), *this, true));
107107 }
108108 return false;
109109 }
114114 if (DumpAsm) {
115115 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
116116 if (AsmPrinterCtor)
117 PM.add(AsmPrinterCtor(errs(), *this, OptLevel, true));
117 PM.add(AsmPrinterCtor(errs(), *this, true));
118118 }
119119 return false;
120120 }
4040 // set this functions to ctor pointer at startup time if they are linked in.
4141 typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o,
4242 TargetMachine &tm,
43 CodeGenOpt::Level OptLevel,
4443 bool verbose);
4544 static AsmPrinterCtorFn AsmPrinterCtor;
4645
3737 ///
3838
3939 explicit AlphaAsmPrinter(raw_ostream &o, TargetMachine &tm,
40 const TargetAsmInfo *T, CodeGenOpt::Level OL,
41 bool V)
42 : AsmPrinter(o, tm, T, OL, V) {}
40 const TargetAsmInfo *T, bool V)
41 : AsmPrinter(o, tm, T, V) {}
4342
4443 virtual const char *getPassName() const {
4544 return "Alpha Assembly Printer";
6968 ///
7069 FunctionPass *llvm::createAlphaCodePrinterPass(raw_ostream &o,
7170 TargetMachine &tm,
72 CodeGenOpt::Level OptLevel,
7371 bool verbose) {
74 return new AlphaAsmPrinter(o, tm, tm.getTargetAsmInfo(), OptLevel, verbose);
72 return new AlphaAsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
7573 }
7674
7775 #include "AlphaGenAsmWriter.inc"
4949 std::set FnStubs, GVStubs;
5050 public:
5151 explicit SPUAsmPrinter(raw_ostream &O, TargetMachine &TM,
52 const TargetAsmInfo *T, CodeGenOpt::Level OL,
53 bool V) :
54 AsmPrinter(O, TM, T, OL, V) {}
52 const TargetAsmInfo *T, bool V) :
53 AsmPrinter(O, TM, T, V) {}
5554
5655 virtual const char *getPassName() const {
5756 return "STI CBEA SPU Assembly Printer";
289288 DwarfWriter *DW;
290289 public:
291290 explicit LinuxAsmPrinter(raw_ostream &O, SPUTargetMachine &TM,
292 const TargetAsmInfo *T, CodeGenOpt::Level F,
293 bool V)
294 : SPUAsmPrinter(O, TM, T, F, V), DW(0) {}
291 const TargetAsmInfo *T, bool V)
292 : SPUAsmPrinter(O, TM, T, V), DW(0) {}
295293
296294 virtual const char *getPassName() const {
297295 return "STI CBEA SPU Assembly Printer";
602600 ///
603601 FunctionPass *llvm::createSPUAsmPrinterPass(raw_ostream &o,
604602 SPUTargetMachine &tm,
605 CodeGenOpt::Level OptLevel,
606603 bool verbose) {
607 return new LinuxAsmPrinter(o, tm, tm.getTargetAsmInfo(), OptLevel, verbose);
604 return new LinuxAsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
608605 }
609606
610607 // Force static initialization.
2525 FunctionPass *createSPUISelDag(SPUTargetMachine &TM);
2626 FunctionPass *createSPUAsmPrinterPass(raw_ostream &o,
2727 SPUTargetMachine &tm,
28 CodeGenOpt::Level OptLevel,
2928 bool verbose);
3029
3130 /*--== Utility functions/predicates/etc used all over the place: --==*/
9393 // Output assembly language.
9494 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
9595 if (AsmPrinterCtor)
96 PM.add(AsmPrinterCtor(Out, *this, OptLevel, Verbose));
96 PM.add(AsmPrinterCtor(Out, *this, Verbose));
9797 return false;
9898 }
4242 // set this functions to ctor pointer at startup time if they are linked in.
4343 typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o,
4444 SPUTargetMachine &tm,
45 CodeGenOpt::Level OptLevel,
4645 bool verbose);
4746 static AsmPrinterCtorFn AsmPrinterCtor;
4847
3737 std::set ExternalFunctionNames, ExternalObjectNames;
3838 public:
3939 explicit IA64AsmPrinter(raw_ostream &O, TargetMachine &TM,
40 const TargetAsmInfo *T, CodeGenOpt::Level OL,
41 bool V)
42 : AsmPrinter(O, TM, T, OL, V) {}
40 const TargetAsmInfo *T, bool V)
41 : AsmPrinter(O, TM, T, V) {}
4342
4443 virtual const char *getPassName() const {
4544 return "IA64 Assembly Printer";
372371 ///
373372 FunctionPass *llvm::createIA64CodePrinterPass(raw_ostream &o,
374373 IA64TargetMachine &tm,
375 CodeGenOpt::Level OptLevel,
376374 bool verbose) {
377 return new IA64AsmPrinter(o, tm, tm.getTargetAsmInfo(), OptLevel, verbose);
375 return new IA64AsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
378376 }
379377
380378 namespace {
3838 ///
3939 FunctionPass *createIA64CodePrinterPass(raw_ostream &o,
4040 IA64TargetMachine &tm,
41 CodeGenOpt::Level OptLevel,
4241 bool verbose);
4342
4443 } // End llvm namespace
7272 //===----------------------------------------------------------------------===//
7373
7474 bool IA64TargetMachine::addInstSelector(PassManagerBase &PM,
75 CodeGenOpt::Level OptLevel){
75 CodeGenOpt::Level OptLevel) {
7676 PM.add(createIA64DAGToDAGInstructionSelector(*this));
7777 return false;
7878 }
9090 // Output assembly language.
9191 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
9292 if (AsmPrinterCtor)
93 PM.add(AsmPrinterCtor(Out, *this, OptLevel, Verbose));
93 PM.add(AsmPrinterCtor(Out, *this, Verbose));
9494 return false;
9595 }
9696
3737 // set this functions to ctor pointer at startup time if they are linked in.
3838 typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o,
3939 IA64TargetMachine &tm,
40 CodeGenOpt::Level OptLevel,
4140 bool verbose);
4241 static AsmPrinterCtorFn AsmPrinterCtor;
4342
2525 CodeGenOpt::Level OptLevel);
2626 FunctionPass *createMSP430CodePrinterPass(raw_ostream &o,
2727 MSP430TargetMachine &tm,
28 CodeGenOpt::Level OptLevel,
2928 bool verbose);
3029 } // end namespace llvm;
3130
3939 class VISIBILITY_HIDDEN MSP430AsmPrinter : public AsmPrinter {
4040 public:
4141 MSP430AsmPrinter(raw_ostream &O, MSP430TargetMachine &TM,
42 const TargetAsmInfo *TAI,
43 CodeGenOpt::Level OL, bool V)
44 : AsmPrinter(O, TM, TAI, OL, V) {}
42 const TargetAsmInfo *TAI, bool V)
43 : AsmPrinter(O, TM, TAI, V) {}
4544
4645 virtual const char *getPassName() const {
4746 return "MSP430 Assembly Printer";
7675 ///
7776 FunctionPass *llvm::createMSP430CodePrinterPass(raw_ostream &o,
7877 MSP430TargetMachine &tm,
79 CodeGenOpt::Level OptLevel,
8078 bool verbose) {
81 return new MSP430AsmPrinter(o, tm, tm.getTargetAsmInfo(), OptLevel, verbose);
79 return new MSP430AsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
8280 }
8381
8482 bool MSP430AsmPrinter::doInitialization(Module &M) {
6161 bool Verbose,
6262 raw_ostream &Out) {
6363 // Output assembly language.
64 PM.add(createMSP430CodePrinterPass(Out, *this, OptLevel, Verbose));
64 PM.add(createMSP430CodePrinterPass(Out, *this, Verbose));
6565 return false;
6666 }
6767
5050 const MipsSubtarget *Subtarget;
5151 public:
5252 explicit MipsAsmPrinter(raw_ostream &O, MipsTargetMachine &TM,
53 const TargetAsmInfo *T, CodeGenOpt::Level OL,
54 bool V)
55 : AsmPrinter(O, TM, T, OL, V) {
53 const TargetAsmInfo *T, bool V)
54 : AsmPrinter(O, TM, T, V) {
5655 Subtarget = &TM.getSubtarget();
5756 }
5857
9291 /// regardless of whether the function is in SSA form.
9392 FunctionPass *llvm::createMipsCodePrinterPass(raw_ostream &o,
9493 MipsTargetMachine &tm,
95 CodeGenOpt::Level OptLevel,
9694 bool verbose) {
97 return new MipsAsmPrinter(o, tm, tm.getTargetAsmInfo(), OptLevel, verbose);
95 return new MipsAsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
9896 }
9997
10098 //===----------------------------------------------------------------------===//
2626 FunctionPass *createMipsDelaySlotFillerPass(MipsTargetMachine &TM);
2727 FunctionPass *createMipsCodePrinterPass(raw_ostream &OS,
2828 MipsTargetMachine &TM,
29 CodeGenOpt::Level OptLevel,
3029 bool Verbose);
3130 } // end namespace llvm;
3231
133133 bool Verbose, raw_ostream &Out) {
134134 // Output assembly language.
135135 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
136 PM.add(AsmPrinterCtor(Out, *this, OptLevel, Verbose));
136 PM.add(AsmPrinterCtor(Out, *this, Verbose));
137137 return false;
138138 }
3838 // linked in.
3939 typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o,
4040 MipsTargetMachine &tm,
41 CodeGenOpt::Level OptLevel,
4241 bool verbose);
4342 static AsmPrinterCtorFn AsmPrinterCtor;
4443
330330 FunctionPass *createPIC16ISelDag(PIC16TargetMachine &TM);
331331 FunctionPass *createPIC16CodePrinterPass(raw_ostream &OS,
332332 PIC16TargetMachine &TM,
333 CodeGenOpt::Level OptLevel,
334333 bool Verbose);
335334 // Banksel optimzer pass.
336335 FunctionPass *createPIC16MemSelOptimizerPass();
112112 ///
113113 FunctionPass *llvm::createPIC16CodePrinterPass(raw_ostream &o,
114114 PIC16TargetMachine &tm,
115 CodeGenOpt::Level OptLevel,
116115 bool verbose) {
117 return new PIC16AsmPrinter(o, tm, tm.getTargetAsmInfo(), OptLevel, verbose);
116 return new PIC16AsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
118117 }
119118
120119
2929 namespace llvm {
3030 struct VISIBILITY_HIDDEN PIC16AsmPrinter : public AsmPrinter {
3131 explicit PIC16AsmPrinter(raw_ostream &O, PIC16TargetMachine &TM,
32 const TargetAsmInfo *T, CodeGenOpt::Level OL,
33 bool V)
34 : AsmPrinter(O, TM, T, OL, V), DbgInfo(O, T) {
32 const TargetAsmInfo *T, bool V)
33 : AsmPrinter(O, TM, T, V), DbgInfo(O, T) {
3534 PTLI = TM.getTargetLowering();
3635 PTAI = static_cast (T);
3736 }
6464 return false;
6565 }
6666
67 bool PIC16TargetMachine::
68 addAssemblyEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,
69 bool Verbose, raw_ostream &Out) {
67 bool PIC16TargetMachine::addAssemblyEmitter(PassManagerBase &PM,
68 CodeGenOpt::Level OptLevel,
69 bool Verbose, raw_ostream &Out) {
7070 // Output assembly language.
71 PM.add(createPIC16CodePrinterPass(Out, *this, OptLevel, Verbose));
71 PM.add(createPIC16CodePrinterPass(Out, *this, Verbose));
7272 return false;
7373 }
7474
5555 const PPCSubtarget &Subtarget;
5656 public:
5757 explicit PPCAsmPrinter(raw_ostream &O, TargetMachine &TM,
58 const TargetAsmInfo *T, CodeGenOpt::Level OL,
59 bool V)
60 : AsmPrinter(O, TM, T, OL, V),
58 const TargetAsmInfo *T, bool V)
59 : AsmPrinter(O, TM, T, V),
6160 Subtarget(TM.getSubtarget()) {}
6261
6362 virtual const char *getPassName() const {
295294 class VISIBILITY_HIDDEN PPCLinuxAsmPrinter : public PPCAsmPrinter {
296295 public:
297296 explicit PPCLinuxAsmPrinter(raw_ostream &O, PPCTargetMachine &TM,
298 const TargetAsmInfo *T, CodeGenOpt::Level OL,
299 bool V)
300 : PPCAsmPrinter(O, TM, T, OL, V){}
297 const TargetAsmInfo *T, bool V)
298 : PPCAsmPrinter(O, TM, T, V){}
301299
302300 virtual const char *getPassName() const {
303301 return "Linux PPC Assembly Printer";
322320 raw_ostream &OS;
323321 public:
324322 explicit PPCDarwinAsmPrinter(raw_ostream &O, PPCTargetMachine &TM,
325 const TargetAsmInfo *T, CodeGenOpt::Level OL,
326 bool V)
327 : PPCAsmPrinter(O, TM, T, OL, V), OS(O) {}
323 const TargetAsmInfo *T, bool V)
324 : PPCAsmPrinter(O, TM, T, V), OS(O) {}
328325
329326 virtual const char *getPassName() const {
330327 return "Darwin PPC Assembly Printer";
11181115 ///
11191116 FunctionPass *llvm::createPPCAsmPrinterPass(raw_ostream &o,
11201117 PPCTargetMachine &tm,
1121 CodeGenOpt::Level OptLevel,
11221118 bool verbose) {
11231119 const PPCSubtarget *Subtarget = &tm.getSubtarget();
11241120
11251121 if (Subtarget->isDarwin()) {
1126 return new PPCDarwinAsmPrinter(o, tm, tm.getTargetAsmInfo(),
1127 OptLevel, verbose);
1122 return new PPCDarwinAsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
11281123 } else {
1129 return new PPCLinuxAsmPrinter(o, tm, tm.getTargetAsmInfo(),
1130 OptLevel, verbose);
1124 return new PPCLinuxAsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
11311125 }
11321126 }
11331127
2727
2828 FunctionPass *createPPCBranchSelectionPass();
2929 FunctionPass *createPPCISelDag(PPCTargetMachine &TM);
30 FunctionPass *createPPCAsmPrinterPass(raw_ostream &OS,
31 PPCTargetMachine &TM,
32 CodeGenOpt::Level OptLevel, bool Verbose);
30 FunctionPass *createPPCAsmPrinterPass(raw_ostream &OS, PPCTargetMachine &TM,
31 bool Verbose);
3332 FunctionPass *createPPCCodeEmitterPass(PPCTargetMachine &TM,
3433 MachineCodeEmitter &MCE);
3534 FunctionPass *createPPCJITCodeEmitterPass(PPCTargetMachine &TM,
151151 raw_ostream &Out) {
152152 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
153153 if (AsmPrinterCtor)
154 PM.add(AsmPrinterCtor(Out, *this, OptLevel, Verbose));
154 PM.add(AsmPrinterCtor(Out, *this, Verbose));
155155
156156 return false;
157157 }
182182 if (DumpAsm) {
183183 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
184184 if (AsmPrinterCtor)
185 PM.add(AsmPrinterCtor(errs(), *this, OptLevel, true));
185 PM.add(AsmPrinterCtor(errs(), *this, true));
186186 }
187187
188188 return false;
214214 if (DumpAsm) {
215215 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
216216 if (AsmPrinterCtor)
217 PM.add(AsmPrinterCtor(errs(), *this, OptLevel, true));
217 PM.add(AsmPrinterCtor(errs(), *this, true));
218218 }
219219
220220 return false;
229229 if (DumpAsm) {
230230 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
231231 if (AsmPrinterCtor)
232 PM.add(AsmPrinterCtor(errs(), *this, OptLevel, true));
232 PM.add(AsmPrinterCtor(errs(), *this, true));
233233 }
234234
235235 return false;
244244 if (DumpAsm) {
245245 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
246246 if (AsmPrinterCtor)
247 PM.add(AsmPrinterCtor(errs(), *this, OptLevel, true));
248 }
249
250 return false;
251 }
252
247 PM.add(AsmPrinterCtor(errs(), *this, true));
248 }
249
250 return false;
251 }
252
4545 // set this functions to ctor pointer at startup time if they are linked in.
4646 typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o,
4747 PPCTargetMachine &tm,
48 CodeGenOpt::Level OptLevel,
4948 bool verbose);
5049 static AsmPrinterCtorFn AsmPrinterCtor;
5150
4949 unsigned BBNumber;
5050 public:
5151 explicit SparcAsmPrinter(raw_ostream &O, TargetMachine &TM,
52 const TargetAsmInfo *T, CodeGenOpt::Level OL,
53 bool V)
54 : AsmPrinter(O, TM, T, OL, V), BBNumber(0) {}
52 const TargetAsmInfo *T, bool V)
53 : AsmPrinter(O, TM, T, V), BBNumber(0) {}
5554
5655 virtual const char *getPassName() const {
5756 return "Sparc Assembly Printer";
8382 ///
8483 FunctionPass *llvm::createSparcCodePrinterPass(raw_ostream &o,
8584 TargetMachine &tm,
86 CodeGenOpt::Level OptLevel,
8785 bool verbose) {
88 return new SparcAsmPrinter(o, tm, tm.getTargetAsmInfo(), OptLevel, verbose);
86 return new SparcAsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
8987 }
9088
9189
2424
2525 FunctionPass *createSparcISelDag(SparcTargetMachine &TM);
2626 FunctionPass *createSparcCodePrinterPass(raw_ostream &OS, TargetMachine &TM,
27 CodeGenOpt::Level OptLevel,
2827 bool Verbose);
2928 FunctionPass *createSparcDelaySlotFillerPass(TargetMachine &TM);
3029 FunctionPass *createSparcFPMoverPass(TargetMachine &TM);
8989 // Output assembly language.
9090 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
9191 if (AsmPrinterCtor)
92 PM.add(AsmPrinterCtor(Out, *this, OptLevel, Verbose));
92 PM.add(AsmPrinterCtor(Out, *this, Verbose));
9393 return false;
9494 }
3838 // set this functions to ctor pointer at startup time if they are linked in.
3939 typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o,
4040 TargetMachine &tm,
41 CodeGenOpt::Level OptLevel,
4241 bool verbose);
4342 static AsmPrinterCtorFn AsmPrinterCtor;
4443
3737 MCStreamer *Streamer;
3838 public:
3939 explicit X86ATTAsmPrinter(raw_ostream &O, X86TargetMachine &TM,
40 const TargetAsmInfo *T, CodeGenOpt::Level OL,
41 bool V)
42 : AsmPrinter(O, TM, T, OL, V) {
40 const TargetAsmInfo *T, bool V)
41 : AsmPrinter(O, TM, T, V) {
4342 Subtarget = &TM.getSubtarget();
4443 Context = 0;
4544 Streamer = 0;
2424 ///
2525 FunctionPass *llvm::createX86CodePrinterPass(raw_ostream &o,
2626 X86TargetMachine &tm,
27 CodeGenOpt::Level OptLevel,
2827 bool verbose) {
2928 const X86Subtarget *Subtarget = &tm.getSubtarget();
3029
3130 if (Subtarget->isFlavorIntel())
32 return new X86IntelAsmPrinter(o, tm, tm.getTargetAsmInfo(),
33 OptLevel, verbose);
34 return new X86ATTAsmPrinter(o, tm, tm.getTargetAsmInfo(),
35 OptLevel, verbose);
31 return new X86IntelAsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
32 return new X86ATTAsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
3633 }
3734
3835 namespace {
2525
2626 struct VISIBILITY_HIDDEN X86IntelAsmPrinter : public AsmPrinter {
2727 explicit X86IntelAsmPrinter(raw_ostream &O, X86TargetMachine &TM,
28 const TargetAsmInfo *T, CodeGenOpt::Level OL,
29 bool V)
30 : AsmPrinter(O, TM, T, OL, V) {}
28 const TargetAsmInfo *T, bool V)
29 : AsmPrinter(O, TM, T, V) {}
3130
3231 virtual const char *getPassName() const {
3332 return "X86 Intel-Style Assembly Printer";
4545 /// assembly code for a MachineFunction to the given output stream,
4646 /// using the given target machine description.
4747 ///
48 FunctionPass *createX86CodePrinterPass(raw_ostream &o,
49 X86TargetMachine &tm,
50 CodeGenOpt::Level OptLevel,
48 FunctionPass *createX86CodePrinterPass(raw_ostream &o, X86TargetMachine &tm,
5149 bool Verbose);
5250
5351 /// createX86CodeEmitterPass - Return a pass that emits the collected X86 code
225225
226226 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
227227 if (AsmPrinterCtor)
228 PM.add(AsmPrinterCtor(Out, *this, OptLevel, Verbose));
228 PM.add(AsmPrinterCtor(Out, *this, Verbose));
229229 return false;
230230 }
231231
253253 if (DumpAsm) {
254254 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
255255 if (AsmPrinterCtor)
256 PM.add(AsmPrinterCtor(errs(), *this, OptLevel, true));
256 PM.add(AsmPrinterCtor(errs(), *this, true));
257257 }
258258
259259 return false;
283283 if (DumpAsm) {
284284 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
285285 if (AsmPrinterCtor)
286 PM.add(AsmPrinterCtor(errs(), *this, OptLevel, true));
286 PM.add(AsmPrinterCtor(errs(), *this, true));
287287 }
288288
289289 return false;
297297 if (DumpAsm) {
298298 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
299299 if (AsmPrinterCtor)
300 PM.add(AsmPrinterCtor(errs(), *this, OptLevel, true));
300 PM.add(AsmPrinterCtor(errs(), *this, true));
301301 }
302302
303303 return false;
311311 if (DumpAsm) {
312312 assert(AsmPrinterCtor && "AsmPrinter was not linked in");
313313 if (AsmPrinterCtor)
314 PM.add(AsmPrinterCtor(errs(), *this, OptLevel, true));
315 }
316
317 return false;
318 }
319
314 PM.add(AsmPrinterCtor(errs(), *this, true));
315 }
316
317 return false;
318 }
319
4444 // set this functions to ctor pointer at startup time if they are linked in.
4545 typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o,
4646 X86TargetMachine &tm,
47 CodeGenOpt::Level OptLevel,
4847 bool verbose);
4948 static AsmPrinterCtorFn AsmPrinterCtor;
5049
2525 FunctionPass *createXCoreISelDag(XCoreTargetMachine &TM);
2626 FunctionPass *createXCoreCodePrinterPass(raw_ostream &OS,
2727 XCoreTargetMachine &TM,
28 CodeGenOpt::Level OptLevel,
2928 bool Verbose);
3029 } // end namespace llvm;
3130
5757 const XCoreSubtarget &Subtarget;
5858 public:
5959 explicit XCoreAsmPrinter(raw_ostream &O, XCoreTargetMachine &TM,
60 const TargetAsmInfo *T, CodeGenOpt::Level OL,
61 bool V)
62 : AsmPrinter(O, TM, T, OL, V), DW(0),
60 const TargetAsmInfo *T, bool V)
61 : AsmPrinter(O, TM, T, V), DW(0),
6362 Subtarget(*TM.getSubtargetImpl()) {}
6463
6564 virtual const char *getPassName() const {
105104 ///
106105 FunctionPass *llvm::createXCoreCodePrinterPass(raw_ostream &o,
107106 XCoreTargetMachine &tm,
108 CodeGenOpt::Level OptLevel,
109107 bool verbose) {
110 return new XCoreAsmPrinter(o, tm, tm.getTargetAsmInfo(), OptLevel, verbose);
108 return new XCoreAsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
111109 }
112110
113111 // PrintEscapedString - Print each character of the specified string, escaping
6868 bool Verbose,
6969 raw_ostream &Out) {
7070 // Output assembly language.
71 PM.add(createXCoreCodePrinterPass(Out, *this, OptLevel, Verbose));
71 PM.add(createXCoreCodePrinterPass(Out, *this, Verbose));
7272 return false;
7373 }