add write bitcode ability

Signed-off-by: xiehuc <xiehuc@gmail.com>