Frank Winter via llvm-dev
2016-May-04 14:47 UTC
[llvm-dev] raw_pwrite_stream on a non-fixed-size buffer?
I wanted to bring this up again. I still try to get access to the assembler of a jit-compiled function/module using llvm 3.8 and later. In 3.8 the interface to addPassesToEmitFile has changed and my old method doesn't work any more. In principle one gets the asm with targetMachine->addPassesToEmitFile( PM , *OS , llvm::TargetMachine::CGFT_AssemblyFile ) where *OS is a raw_pwrite_stream. The problem is that I only find use cases of raw_pwrite_stream where the derived class raw_svector_ostream is initialized on a SmallString, like SmallString<128> Str; raw_svector_ostream OS(Str); However, the assembler of the modules could be arbitrary large (not fitting in any finite sized SmallString) What can I do? Thanks, Frank
Yaron Keren via llvm-dev
2016-May-04 14:58 UTC
[llvm-dev] raw_pwrite_stream on a non-fixed-size buffer?
SmallString template parameter is the initial buffer size, but it resizes automatically as needed. 2016-05-04 17:47 GMT+03:00 Frank Winter via llvm-dev < llvm-dev at lists.llvm.org>:> I wanted to bring this up again. I still try to get access to the > assembler of a jit-compiled function/module using llvm 3.8 and later. In > 3.8 the interface to addPassesToEmitFile has changed and my old method > doesn't work any more. > > In principle one gets the asm with > > targetMachine->addPassesToEmitFile( PM , *OS , > llvm::TargetMachine::CGFT_AssemblyFile ) > > where *OS is a raw_pwrite_stream. > > The problem is that I only find use cases of raw_pwrite_stream where the > derived class raw_svector_ostream is initialized on a SmallString, like > > SmallString<128> Str; > raw_svector_ostream OS(Str); > > However, the assembler of the modules could be arbitrary large (not > fitting in any finite sized SmallString) > > What can I do? > > Thanks, > Frank > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160504/7e9b74e9/attachment.html>
Frank Winter via llvm-dev
2016-May-04 15:14 UTC
[llvm-dev] raw_pwrite_stream on a non-fixed-size buffer?
Thanks! It works. Frank On 05/04/2016 10:58 AM, Yaron Keren wrote:> SmallString template parameter is the initial buffer size, but it > resizes automaticallyas needed. > > > 2016-05-04 17:47 GMT+03:00 Frank Winter via llvm-dev > <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>>: > > I wanted to bring this up again. I still try to get access to the > assembler of a jit-compiled function/module using llvm 3.8 and > later. In 3.8 the interface to addPassesToEmitFile has changed and > my old method doesn't work any more. > > In principle one gets the asm with > > targetMachine->addPassesToEmitFile( PM , *OS , > llvm::TargetMachine::CGFT_AssemblyFile ) > > where *OS is a raw_pwrite_stream. > > The problem is that I only find use cases of raw_pwrite_stream where > the derived class raw_svector_ostream is initialized on a > SmallString, like > > SmallString<128> Str; > raw_svector_ostream OS(Str); > > However, the assembler of the modules could be arbitrary large (not > fitting in any finite sized SmallString) > > What can I do? > > Thanks, > Frank > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >
Maybe Matching Threads
- raw_pwrite_stream to string or stdout?
- raw_pwrite_stream to string or stdout?
- Help with pass manager
- [LLVMdev] SmallString + raw_svector_ostream combination should be more efficient
- [LLVMdev] SmallString + raw_svector_ostream combination should be more efficient