File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
llvm/lib/CodeGen/AsmPrinter Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -478,11 +478,13 @@ bool AsmPrinter::doInitialization(Module &M) {
478
478
// use the directive, where it would need the same conditionalization
479
479
// anyway.
480
480
const Triple &Target = TM.getTargetTriple ();
481
- Triple TVT (M.getDarwinTargetVariantTriple ());
482
- OutStreamer->emitVersionForTarget (
483
- Target, M.getSDKVersion (),
484
- M.getDarwinTargetVariantTriple ().empty () ? nullptr : &TVT,
485
- M.getDarwinTargetVariantSDKVersion ());
481
+ if (Target.isOSBinFormatMachO () && Target.isOSDarwin ()) {
482
+ Triple TVT (M.getDarwinTargetVariantTriple ());
483
+ OutStreamer->emitVersionForTarget (
484
+ Target, M.getSDKVersion (),
485
+ M.getDarwinTargetVariantTriple ().empty () ? nullptr : &TVT,
486
+ M.getDarwinTargetVariantSDKVersion ());
487
+ }
486
488
487
489
// Allow the target to emit any magic that it wants at the start of the file.
488
490
emitStartOfAsmFile (M);
You can’t perform that action at this time.
0 commit comments