mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
Don't create an output stream when output is disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104875 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9d2cbffed0
commit
7f924a3116
@ -379,26 +379,28 @@ 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 = true;
|
||||
if (OutputFilename == "-") {
|
||||
Out = &outs(); // Default to printing to stdout...
|
||||
DeleteStream = false;
|
||||
} else {
|
||||
if (NoOutput || AnalyzeOnly) {
|
||||
errs() << "WARNING: The -o (output filename) option is ignored when\n"
|
||||
"the --disable-output or --analyze options are used.\n";
|
||||
bool DeleteStream = false;
|
||||
if (!NoOutput && !AnalyzeOnly) {
|
||||
if (OutputFilename == "-") {
|
||||
Out = &outs(); // Default to printing to stdout...
|
||||
} else {
|
||||
// Make sure that the Output file gets unlinked from the disk if we get a
|
||||
// SIGINT
|
||||
sys::RemoveFileOnSignal(sys::Path(OutputFilename));
|
||||
if (NoOutput || AnalyzeOnly) {
|
||||
errs() << "WARNING: The -o (output filename) option is ignored when\n"
|
||||
"the --disable-output or --analyze options are used.\n";
|
||||
} else {
|
||||
// Make sure that the Output file gets unlinked from the disk if we get
|
||||
// a SIGINT.
|
||||
sys::RemoveFileOnSignal(sys::Path(OutputFilename));
|
||||
|
||||
std::string ErrorInfo;
|
||||
Out = new raw_fd_ostream(OutputFilename.c_str(), ErrorInfo,
|
||||
raw_fd_ostream::F_Binary);
|
||||
if (!ErrorInfo.empty()) {
|
||||
errs() << ErrorInfo << '\n';
|
||||
delete Out;
|
||||
return 1;
|
||||
std::string ErrorInfo;
|
||||
Out = new raw_fd_ostream(OutputFilename.c_str(), ErrorInfo,
|
||||
raw_fd_ostream::F_Binary);
|
||||
if (!ErrorInfo.empty()) {
|
||||
errs() << ErrorInfo << '\n';
|
||||
delete Out;
|
||||
return 1;
|
||||
}
|
||||
DeleteStream = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user