TargetRegistry: Reorganize AsmPrinter construction so that clients pass in the
TargetAsmInfo. This eliminates a dependency on TargetMachine.h from
TargetRegistry.h, which technically was a layering violation.
- Clients probably can only sensibly pass in the same TargetAsmInfo as the
TargetMachine has, but there are only limited clients of this API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78928 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp
index 71efa13..cafe4d3 100644
--- a/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/lib/CodeGen/LLVMTargetMachine.cpp
@@ -106,7 +106,8 @@
CodeGenOpt::Level OptLevel,
bool Verbose,
formatted_raw_ostream &Out) {
- FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
+ FunctionPass *Printer =
+ getTarget().createAsmPrinter(Out, *this, getTargetAsmInfo(), Verbose);
if (!Printer)
return true;