[LLVMdev] Fwd: write module to .bc file

charles quarra charllsnotieneningunputocorreo at gmail.com
Sun Dec 16 09:47:08 PST 2012

nevermind, i found how to write to a fd_stream;

---------- Forwarded message ----------
From: charles quarra <charllsnotieneningunputocorreo at gmail.com>
Date: 2012/12/16
Subject: write module to .bc file
To: llvmdev at cs.uiuc.edu

 i'm afraid this question is extremely basic, but i've assumed that
dumping a .bc file from a module was a trivial operation, but now,
first time i have to actually do it from code, for the life of me i
can't find one missing step in the process:

static void WriteModule ( const Module *  M, BitstreamWriter &  Stream )

to write that module, first i need a BistreamWriter

BitstreamWriter::BitstreamWriter (SmallVectorImpl< char > &O)

and for a BitstreamWriter i need a SmallVectorImpl. But, what next?
Should i write the content of the SmallVectorImpl byte by byte on a
file handler myself? is there a llvm api for this? do i need something

More information about the llvm-dev mailing list