mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-29 13:24:25 +00:00
Changes to build successfully with GCC 3.02
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1503 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -122,10 +122,16 @@ int main(int argc, char **argv) {
|
||||
for (unsigned i = 0; i < OptimizationList.size(); ++i)
|
||||
RunOptimization(M.get(), OptimizationList[i]);
|
||||
|
||||
ostream *Out = &cout; // Default to printing to stdout...
|
||||
std::ostream *Out = &std::cout; // Default to printing to stdout...
|
||||
if (OutputFilename != "") {
|
||||
Out = new ofstream(OutputFilename.c_str(),
|
||||
(Force ? 0 : ios::noreplace)|ios::out);
|
||||
if (!Force && !std::ifstream(OutputFilename.c_str())) {
|
||||
// If force is not specified, make sure not to overwrite a file!
|
||||
cerr << "Error opening '" << OutputFilename << "': File exists!\n"
|
||||
<< "Use -f command line argument to force output\n";
|
||||
return 1;
|
||||
}
|
||||
Out = new std::ofstream(OutputFilename.c_str());
|
||||
|
||||
if (!Out->good()) {
|
||||
cerr << "Error opening " << OutputFilename << "!\n";
|
||||
return 1;
|
||||
|
Reference in New Issue
Block a user