Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/rustllvm/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,8 @@ LLVMRustWriteOutputFile(LLVMTargetMachineRef Target, LLVMPassManagerRef PMR,
}

#if LLVM_VERSION_GE(7, 0)
unwrap(Target)->addPassesToEmitFile(*PM, OS, nullptr, FileType, false);
buffer_ostream BOS(OS);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this is only done on 7.0+? Seems like we could do it for other LLVMs as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to muck around with older versions without testing, so I opted to leave it here (it doesn't really matter for older llvm, a slightly slower compiler is the least of those worries)

unwrap(Target)->addPassesToEmitFile(*PM, BOS, nullptr, FileType, false);
#else
unwrap(Target)->addPassesToEmitFile(*PM, OS, FileType, false);
#endif
Expand Down