diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-03-11 01:34:27 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-03-11 01:34:27 +0000 |
commit | 1f3e445184e5ca2aa4295c2a77f2a4e0b957fea1 (patch) | |
tree | 060822a8b47bee4f9ad49e2a8549ca9b39113d5d /lib/CodeGen/LLVMTargetMachine.cpp | |
parent | 23ac7c78e4f009e0baa6d42f4fd0143769fbed4a (diff) |
MC: Provide MCAssembler with a TargetAsmBackend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98222 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r-- | lib/CodeGen/LLVMTargetMachine.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp index 9bc0b7121d..23ef8ba7ce 100644 --- a/lib/CodeGen/LLVMTargetMachine.cpp +++ b/lib/CodeGen/LLVMTargetMachine.cpp @@ -94,8 +94,8 @@ static cl::opt<bool> EnableSplitGEPGVN("split-gep-gvn", cl::Hidden, cl::desc("Split GEPs and run no-load GVN")); LLVMTargetMachine::LLVMTargetMachine(const Target &T, - const std::string &TargetTriple) - : TargetMachine(T) { + const std::string &Triple) + : TargetMachine(T), TargetTriple(Triple) { AsmInfo = T.createAsmInfo(TargetTriple); } @@ -143,10 +143,11 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM, // Create the code emitter for the target if it exists. If not, .o file // emission fails. MCCodeEmitter *MCE = getTarget().createCodeEmitter(*this, *Context); - if (MCE == 0) + TargetAsmBackend *TAB = getTarget().createAsmBackend(TargetTriple); + if (MCE == 0 || TAB == 0) return true; - AsmStreamer.reset(createMachOStreamer(*Context, Out, MCE)); + AsmStreamer.reset(createMachOStreamer(*Context, *TAB, Out, MCE)); // Any output to the asmprinter's "O" stream is bad and needs to be fixed, // force it to come out stderr. |