[llvm-dev] raw_pwrite_stream on a non-fixed-size buffer?

Frank Winter via llvm-dev llvm-dev at lists.llvm.org
Wed May 4 07:47:36 PDT 2016


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


More information about the llvm-dev mailing list