mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-16 19:19:10 +00:00
Generalize the darwin wrapper hack to work with generic macho triples as well as darwin ones.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120346 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
03f44a04e6
commit
695b281186
@ -1642,9 +1642,12 @@ void llvm::WriteBitcodeToFile(const Module *M, raw_ostream &Out) {
|
|||||||
/// WriteBitcodeToStream - Write the specified module to the specified output
|
/// WriteBitcodeToStream - Write the specified module to the specified output
|
||||||
/// stream.
|
/// stream.
|
||||||
void llvm::WriteBitcodeToStream(const Module *M, BitstreamWriter &Stream) {
|
void llvm::WriteBitcodeToStream(const Module *M, BitstreamWriter &Stream) {
|
||||||
// If this is darwin, emit a file header and trailer if needed.
|
// If this is darwin or another generic macho target, emit a file header and
|
||||||
bool isDarwin = M->getTargetTriple().find("-darwin") != std::string::npos;
|
// trailer if needed.
|
||||||
if (isDarwin)
|
bool isMacho =
|
||||||
|
M->getTargetTriple().find("-darwin") != std::string::npos ||
|
||||||
|
M->getTargetTriple().find("-macho") != std::string::npos;
|
||||||
|
if (isMacho)
|
||||||
EmitDarwinBCHeader(Stream, M->getTargetTriple());
|
EmitDarwinBCHeader(Stream, M->getTargetTriple());
|
||||||
|
|
||||||
// Emit the file header.
|
// Emit the file header.
|
||||||
@ -1658,6 +1661,6 @@ void llvm::WriteBitcodeToStream(const Module *M, BitstreamWriter &Stream) {
|
|||||||
// Emit the module.
|
// Emit the module.
|
||||||
WriteModule(M, Stream);
|
WriteModule(M, Stream);
|
||||||
|
|
||||||
if (isDarwin)
|
if (isMacho)
|
||||||
EmitDarwinBCTrailer(Stream, Stream.getBuffer().size());
|
EmitDarwinBCTrailer(Stream, Stream.getBuffer().size());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user