diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2008-08-17 13:53:59 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2008-08-17 13:53:59 +0000 |
commit | 3c3bc48d331db26aaff3ff4f7a61f60a17fea112 (patch) | |
tree | 7cbec58b1aa254700ddac87d52819a0751d5ab11 /lib/Target/X86/X86TargetMachine.cpp | |
parent | abb247fc036d55d06b06853cae66ab055269d605 (diff) | |
download | external_llvm-3c3bc48d331db26aaff3ff4f7a61f60a17fea112.zip external_llvm-3c3bc48d331db26aaff3ff4f7a61f60a17fea112.tar.gz external_llvm-3c3bc48d331db26aaff3ff4f7a61f60a17fea112.tar.bz2 |
Move X86 assembler printers into separate directory. This allows JIT-only users not to link it in (use 'x86codegen' llvm-config arg for this)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54886 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86TargetMachine.cpp')
-rw-r--r-- | lib/Target/X86/X86TargetMachine.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp index fdf9bdf..ba3314c 100644 --- a/lib/Target/X86/X86TargetMachine.cpp +++ b/lib/Target/X86/X86TargetMachine.cpp @@ -35,6 +35,9 @@ X("x86", " 32-bit X86: Pentium-Pro and above"); static RegisterTarget<X86_64TargetMachine> Y("x86-64", " 64-bit X86: EM64T and AMD64"); +// No assembler printer by default +X86TargetMachine::AsmPrinterCtorFn X86TargetMachine::AsmPrinterCtor = 0; + const TargetAsmInfo *X86TargetMachine::createTargetAsmInfo() const { if (Subtarget.isFlavorIntel()) return new X86WinTargetAsmInfo(*this); @@ -187,7 +190,9 @@ bool X86TargetMachine::addPostRegAlloc(PassManagerBase &PM, bool Fast) { bool X86TargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, std::ostream &Out) { - PM.add(createX86CodePrinterPass(Out, *this)); + assert(AsmPrinterCtor && "AsmPrinter was not linked in"); + if (AsmPrinterCtor) + PM.add(AsmPrinterCtor(Out, *this)); return false; } @@ -210,8 +215,11 @@ bool X86TargetMachine::addCodeEmitter(PassManagerBase &PM, bool Fast, } PM.add(createX86CodeEmitterPass(*this, MCE)); - if (DumpAsm) - PM.add(createX86CodePrinterPass(*cerr.stream(), *this)); + if (DumpAsm) { + assert(AsmPrinterCtor && "AsmPrinter was not linked in"); + if (AsmPrinterCtor) + PM.add(AsmPrinterCtor(*cerr.stream(), *this)); + } return false; } @@ -219,7 +227,11 @@ bool X86TargetMachine::addCodeEmitter(PassManagerBase &PM, bool Fast, bool X86TargetMachine::addSimpleCodeEmitter(PassManagerBase &PM, bool Fast, bool DumpAsm, MachineCodeEmitter &MCE) { PM.add(createX86CodeEmitterPass(*this, MCE)); - if (DumpAsm) - PM.add(createX86CodePrinterPass(*cerr.stream(), *this)); + if (DumpAsm) { + assert(AsmPrinterCtor && "AsmPrinter was not linked in"); + if (AsmPrinterCtor) + PM.add(AsmPrinterCtor(*cerr.stream(), *this)); + } + return false; } |