aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-15 23:34:19 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-15 23:34:19 +0000
commitf0cda48cf2490ed0212fc438beec5e803beb87f1 (patch)
tree0e6f8a7fd01620ae49b3de9719162d9a6d4ef6f8 /lib/CodeGen
parent503885837aa1ecda6dac159b930343203adda960 (diff)
downloadexternal_llvm-f0cda48cf2490ed0212fc438beec5e803beb87f1.zip
external_llvm-f0cda48cf2490ed0212fc438beec5e803beb87f1.tar.gz
external_llvm-f0cda48cf2490ed0212fc438beec5e803beb87f1.tar.bz2
Lift addAssemblyEmitter into LLVMTargetMachine.
- No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75859 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/LLVMTargetMachine.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp
index 15eac94..6e8b374 100644
--- a/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/lib/CodeGen/LLVMTargetMachine.cpp
@@ -92,6 +92,17 @@ LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
return FileModel::Error;
}
+bool LLVMTargetMachine::addAssemblyEmitter(PassManagerBase &PM,
+ CodeGenOpt::Level OptLevel,
+ bool Verbose,
+ formatted_raw_ostream &Out) {
+ FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
+ if (!Printer)
+ llvm_report_error("unable to create assembly printer");
+ PM.add(Printer);
+ return false;
+}
+
/// addPassesToEmitFileFinish - If the passes to emit the specified file had to
/// be split up (e.g., to add an object writer pass), this method can be used to
/// finish up adding passes to emit the file, if necessary.