From 1235d280d82e5fb0eb7033b4a2eafc8b7b52ceb0 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Sat, 23 Jan 2016 16:02:10 +0000 Subject: [Bitcode] Insert the darwin wrapper at the beginning of a file when the target is macho. It looks like the check for macho was accidentally dropped in r132959. I don't have a test case, but I'll add one if anyone knows how this can be tested. llvm-svn: 258627 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp') diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 5760a64..c3a7411 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -3045,7 +3045,7 @@ void llvm::WriteBitcodeToFile(const Module *M, raw_ostream &Out, // If this is darwin or another generic macho target, reserve space for the // header. Triple TT(M->getTargetTriple()); - if (TT.isOSDarwin()) + if (TT.isOSDarwin() || TT.isOSBinFormatMachO()) Buffer.insert(Buffer.begin(), DarwinBCHeaderSize, 0); // Emit the module into the buffer. @@ -3067,7 +3067,7 @@ void llvm::WriteBitcodeToFile(const Module *M, raw_ostream &Out, EmitFunctionSummary); } - if (TT.isOSDarwin()) + if (TT.isOSDarwin() || TT.isOSBinFormatMachO()) EmitDarwinBCHeaderAndTrailer(Buffer, TT); // Write the generated bitstream to "Out". -- cgit v1.1