mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-28 07:17:32 +00:00
Don't special-case stdout in llvm::WriteBitcodeToFile; just consider
it to be the caller's responsibility to provide a stream in binary mode. This fixes a layering violation and avoids an outs() call. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104878 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -377,12 +377,16 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
// Figure out what stream we are supposed to write to...
|
||||
// FIXME: outs() is not binary!
|
||||
raw_ostream *Out = 0;
|
||||
bool DeleteStream = false;
|
||||
if (!NoOutput && !AnalyzeOnly) {
|
||||
if (OutputFilename == "-") {
|
||||
Out = &outs(); // Default to printing to stdout...
|
||||
// Print to stdout.
|
||||
Out = &outs();
|
||||
// If we're printing a bitcode file, switch stdout to binary mode.
|
||||
// FIXME: This switches outs() globally, not just for the bitcode output.
|
||||
if (!OutputAssembly)
|
||||
sys::Program::ChangeStdoutToBinary();
|
||||
} else {
|
||||
if (NoOutput || AnalyzeOnly) {
|
||||
errs() << "WARNING: The -o (output filename) option is ignored when\n"
|
||||
|
Reference in New Issue
Block a user