diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-07-20 21:56:13 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-07-20 21:56:13 +0000 |
commit | 775472112da257a6558fb583d71aa850860dd8a1 (patch) | |
tree | eb2e4ac32c323f3d63e4fc40edf78a51f38d4d11 /lib/Target | |
parent | 0012b2eb7564542269c8d266a61c8136a92ed75c (diff) | |
download | external_llvm-775472112da257a6558fb583d71aa850860dd8a1.zip external_llvm-775472112da257a6558fb583d71aa850860dd8a1.tar.gz external_llvm-775472112da257a6558fb583d71aa850860dd8a1.tar.bz2 |
Added -print-emitted-asm to print out JIT generated asm to cerr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40123 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/ARM/ARMTargetMachine.cpp | 8 | ||||
-rw-r--r-- | lib/Target/ARM/ARMTargetMachine.h | 4 | ||||
-rw-r--r-- | lib/Target/Alpha/AlphaTargetMachine.cpp | 8 | ||||
-rw-r--r-- | lib/Target/Alpha/AlphaTargetMachine.h | 4 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCTargetMachine.cpp | 8 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCTargetMachine.h | 4 | ||||
-rw-r--r-- | lib/Target/X86/X86TargetMachine.cpp | 9 | ||||
-rw-r--r-- | lib/Target/X86/X86TargetMachine.h | 4 |
8 files changed, 32 insertions, 17 deletions
diff --git a/lib/Target/ARM/ARMTargetMachine.cpp b/lib/Target/ARM/ARMTargetMachine.cpp index 58b3ab9..b29f84d 100644 --- a/lib/Target/ARM/ARMTargetMachine.cpp +++ b/lib/Target/ARM/ARMTargetMachine.cpp @@ -143,18 +143,22 @@ bool ARMTargetMachine::addAssemblyEmitter(FunctionPassManager &PM, bool Fast, bool ARMTargetMachine::addCodeEmitter(FunctionPassManager &PM, bool Fast, - MachineCodeEmitter &MCE) { + bool DumpAsm, MachineCodeEmitter &MCE) { // FIXME: Move this to TargetJITInfo! setRelocationModel(Reloc::Static); // Machine code emitter pass for ARM. PM.add(createARMCodeEmitterPass(*this, MCE)); + if (DumpAsm) + PM.add(createARMCodePrinterPass(*cerr.stream(), *this)); return false; } bool ARMTargetMachine::addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast, - MachineCodeEmitter &MCE) { + bool DumpAsm, MachineCodeEmitter &MCE) { // Machine code emitter pass for ARM. PM.add(createARMCodeEmitterPass(*this, MCE)); + if (DumpAsm) + PM.add(createARMCodePrinterPass(*cerr.stream(), *this)); return false; } diff --git a/lib/Target/ARM/ARMTargetMachine.h b/lib/Target/ARM/ARMTargetMachine.h index 183a582..5d65285 100644 --- a/lib/Target/ARM/ARMTargetMachine.h +++ b/lib/Target/ARM/ARMTargetMachine.h @@ -61,9 +61,9 @@ public: virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast, std::ostream &Out); virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast, - MachineCodeEmitter &MCE); + bool DumpAsm, MachineCodeEmitter &MCE); virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast, - MachineCodeEmitter &MCE); + bool DumpAsm, MachineCodeEmitter &MCE); }; /// ThumbTargetMachine - Thumb target machine. diff --git a/lib/Target/Alpha/AlphaTargetMachine.cpp b/lib/Target/Alpha/AlphaTargetMachine.cpp index d4137a5..f051da4 100644 --- a/lib/Target/Alpha/AlphaTargetMachine.cpp +++ b/lib/Target/Alpha/AlphaTargetMachine.cpp @@ -86,12 +86,14 @@ bool AlphaTargetMachine::addAssemblyEmitter(FunctionPassManager &PM, bool Fast, return false; } bool AlphaTargetMachine::addCodeEmitter(FunctionPassManager &PM, bool Fast, - MachineCodeEmitter &MCE) { + bool DumpAsm, MachineCodeEmitter &MCE) { PM.add(createAlphaCodeEmitterPass(*this, MCE)); + if (DumpAsm) + PM.add(createAlphaCodePrinterPass(*cerr.stream(), *this)); return false; } bool AlphaTargetMachine::addSimpleCodeEmitter(FunctionPassManager &PM, - bool Fast, + bool Fast, bool DumpAsm, MachineCodeEmitter &MCE) { - return addCodeEmitter(PM, Fast, MCE); + return addCodeEmitter(PM, Fast, DumpAsm, MCE); } diff --git a/lib/Target/Alpha/AlphaTargetMachine.h b/lib/Target/Alpha/AlphaTargetMachine.h index 5a57f63..8eb6f54 100644 --- a/lib/Target/Alpha/AlphaTargetMachine.h +++ b/lib/Target/Alpha/AlphaTargetMachine.h @@ -63,9 +63,9 @@ public: virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast, std::ostream &Out); virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast, - MachineCodeEmitter &MCE); + bool DumpAsm, MachineCodeEmitter &MCE); virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast, - MachineCodeEmitter &MCE); + bool DumpAsm, MachineCodeEmitter &MCE); }; } // end namespace llvm diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp index 57c8437..86da3d7 100644 --- a/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -137,7 +137,7 @@ bool PPCTargetMachine::addAssemblyEmitter(FunctionPassManager &PM, bool Fast, } bool PPCTargetMachine::addCodeEmitter(FunctionPassManager &PM, bool Fast, - MachineCodeEmitter &MCE) { + bool DumpAsm, MachineCodeEmitter &MCE) { // The JIT should use the static relocation model in ppc32 mode, PIC in ppc64. // FIXME: This should be moved to TargetJITInfo!! if (Subtarget.isPPC64()) { @@ -155,12 +155,16 @@ bool PPCTargetMachine::addCodeEmitter(FunctionPassManager &PM, bool Fast, // Machine code emitter pass for PowerPC. PM.add(createPPCCodeEmitterPass(*this, MCE)); + if (DumpAsm) + PM.add(createPPCAsmPrinterPass(*cerr.stream(), *this)); return false; } bool PPCTargetMachine::addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast, - MachineCodeEmitter &MCE) { + bool DumpAsm, MachineCodeEmitter &MCE) { // Machine code emitter pass for PowerPC. PM.add(createPPCCodeEmitterPass(*this, MCE)); + if (DumpAsm) + PM.add(createPPCAsmPrinterPass(*cerr.stream(), *this)); return false; } diff --git a/lib/Target/PowerPC/PPCTargetMachine.h b/lib/Target/PowerPC/PPCTargetMachine.h index 10c5b7b..a00f858 100644 --- a/lib/Target/PowerPC/PPCTargetMachine.h +++ b/lib/Target/PowerPC/PPCTargetMachine.h @@ -70,9 +70,9 @@ public: virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast, std::ostream &Out); virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast, - MachineCodeEmitter &MCE); + bool DumpAsm, MachineCodeEmitter &MCE); virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast, - MachineCodeEmitter &MCE); + bool DumpAsm, MachineCodeEmitter &MCE); virtual const bool getEnableTailMergeDefault() const; }; diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp index 4d4bd3f..02fbf95 100644 --- a/lib/Target/X86/X86TargetMachine.cpp +++ b/lib/Target/X86/X86TargetMachine.cpp @@ -170,7 +170,7 @@ bool X86TargetMachine::addAssemblyEmitter(FunctionPassManager &PM, bool Fast, } bool X86TargetMachine::addCodeEmitter(FunctionPassManager &PM, bool Fast, - MachineCodeEmitter &MCE) { + bool DumpAsm, MachineCodeEmitter &MCE) { // FIXME: Move this to TargetJITInfo! setRelocationModel(Reloc::Static); Subtarget.setPICStyle(PICStyle::None); @@ -180,11 +180,16 @@ bool X86TargetMachine::addCodeEmitter(FunctionPassManager &PM, bool Fast, setCodeModel(CodeModel::Large); PM.add(createX86CodeEmitterPass(*this, MCE)); + if (DumpAsm) + PM.add(createX86CodePrinterPass(*cerr.stream(), *this)); + return false; } bool X86TargetMachine::addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast, - MachineCodeEmitter &MCE) { + bool DumpAsm, MachineCodeEmitter &MCE) { PM.add(createX86CodeEmitterPass(*this, MCE)); + if (DumpAsm) + PM.add(createX86CodePrinterPass(*cerr.stream(), *this)); return false; } diff --git a/lib/Target/X86/X86TargetMachine.h b/lib/Target/X86/X86TargetMachine.h index 0a4f1b5..56f8225 100644 --- a/lib/Target/X86/X86TargetMachine.h +++ b/lib/Target/X86/X86TargetMachine.h @@ -65,9 +65,9 @@ public: virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast, std::ostream &Out); virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast, - MachineCodeEmitter &MCE); + bool DumpAsm, MachineCodeEmitter &MCE); virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast, - MachineCodeEmitter &MCE); + bool DumpAsm, MachineCodeEmitter &MCE); }; /// X86_32TargetMachine - X86 32-bit target machine. |