cherry picked bitcode writing from llvm-3.3 branch
removed import of unicode-unsafe string functions