1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00

[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
This commit is contained in:
Akira Hatanaka 2016-01-23 16:02:10 +00:00
parent ab11289986
commit dfd425a3de

View File

@ -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".