llvm.org GIT mirror llvm / 843efd4
Don't make F_None the default. This will make it easier to switch the default to being binary files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202042 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 6 years ago
11 changed file(s) with 15 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
6868
6969 errs() << "Writing '" << Filename << "'...";
7070
71 raw_fd_ostream File(Filename.c_str(), ErrorInfo);
71 raw_fd_ostream File(Filename.c_str(), ErrorInfo, sys::fs::F_None);
7272 std::string GraphName = DOTGraphTraits::getGraphName(Graph);
7373 std::string Title = GraphName + " for '" + F.getName().str() + "' function";
7474
131131
132132 errs() << "Writing '" << Filename << "'...";
133133
134 raw_fd_ostream File(Filename.c_str(), ErrorInfo);
134 raw_fd_ostream File(Filename.c_str(), ErrorInfo, sys::fs::F_None);
135135 std::string Title = DOTGraphTraits::getGraphName(Graph);
136136
137137 if (ErrorInfo.empty())
4646 /// tool_output_file - This constructor's arguments are passed to
4747 /// to raw_fd_ostream's constructor.
4848 tool_output_file(const char *filename, std::string &ErrorInfo,
49 sys::fs::OpenFlags Flags = sys::fs::F_None);
49 sys::fs::OpenFlags Flags);
5050
5151 tool_output_file(const char *Filename, int FD);
5252
346346 /// file descriptor when it is done (this is necessary to detect
347347 /// output errors).
348348 raw_fd_ostream(const char *Filename, std::string &ErrorInfo,
349 sys::fs::OpenFlags Flags = sys::fs::F_None);
349 sys::fs::OpenFlags Flags);
350350
351351 /// raw_fd_ostream ctor - FD is the file descriptor that this writes to. If
352352 /// ShouldClose is true, this closes the file when the stream is destroyed.
7979 errs() << "Writing '" << Filename << "'...";
8080
8181 std::string ErrorInfo;
82 raw_fd_ostream File(Filename.c_str(), ErrorInfo);
82 raw_fd_ostream File(Filename.c_str(), ErrorInfo, sys::fs::F_None);
8383
8484 if (ErrorInfo.empty())
8585 WriteGraph(File, (const Function*)&F);
113113 errs() << "Writing '" << Filename << "'...";
114114
115115 std::string ErrorInfo;
116 raw_fd_ostream File(Filename.c_str(), ErrorInfo);
116 raw_fd_ostream File(Filename.c_str(), ErrorInfo, sys::fs::F_None);
117117
118118 if (ErrorInfo.empty())
119119 WriteGraph(File, (const Function*)&F, true);
594594 rs << round;
595595 std::string graphFileName(fqn + "." + rs.str() + ".pbqpgraph");
596596 std::string tmp;
597 raw_fd_ostream os(graphFileName.c_str(), tmp);
597 raw_fd_ostream os(graphFileName.c_str(), tmp, sys::fs::F_None);
598598 DEBUG(dbgs() << "Dumping graph for round " << round << " to \""
599599 << graphFileName << "\"\n");
600600 problem->getGraph().dump(os);
129129 LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename,
130130 char **ErrorMessage) {
131131 std::string error;
132 raw_fd_ostream dest(Filename, error);
132 raw_fd_ostream dest(Filename, error, sys::fs::F_None);
133133 if (!error.empty()) {
134134 *ErrorMessage = strdup(error.c_str());
135135 return true;
481481 std::string CoveragePath = mangleCoveragePath(Filename,
482482 Options.PreservePaths);
483483 std::string ErrorInfo;
484 raw_fd_ostream OS(CoveragePath.c_str(), ErrorInfo);
484 raw_fd_ostream OS(CoveragePath.c_str(), ErrorInfo, sys::fs::F_None);
485485 if (!ErrorInfo.empty())
486486 errs() << ErrorInfo << "\n";
487487
5656 return 1;
5757 }
5858 std::string Error;
59 tool_output_file DepOut(DependFilename.c_str(), Error);
59 tool_output_file DepOut(DependFilename.c_str(), Error, sys::fs::F_None);
6060 if (!Error.empty()) {
6161 errs() << argv0 << ": error opening " << DependFilename
6262 << ":" << Error << "\n";
102102 return 1;
103103
104104 std::string Error;
105 tool_output_file Out(OutputFilename.c_str(), Error);
105 tool_output_file Out(OutputFilename.c_str(), Error, sys::fs::F_None);
106106 if (!Error.empty()) {
107107 errs() << argv0 << ": error opening " << OutputFilename
108108 << ":" << Error << "\n";
527527
528528 if (!fd) {
529529 std::string Path = getPath();
530 Out.reset(new raw_fd_ostream(Path.c_str(), error));
530 Out.reset(new raw_fd_ostream(Path.c_str(), error, sys::fs::F_None));
531531 DEBUG(dbgs() << "WRITING debug bitcode from Module " << M << " to file "
532532 << Path << "\n");
533533 } else {
191191 MCInstPrinter *IP) {
192192 // Start a new dot file.
193193 std::string Error;
194 raw_fd_ostream Out(FileName, Error);
194 raw_fd_ostream Out(FileName, Error, sys::fs::F_None);
195195 if (!Error.empty()) {
196196 errs() << "llvm-objdump: warning: " << Error << '\n';
197197 return;
372372 }
373373 if (!YAMLCFG.empty()) {
374374 std::string Error;
375 raw_fd_ostream YAMLOut(YAMLCFG.c_str(), Error);
375 raw_fd_ostream YAMLOut(YAMLCFG.c_str(), Error, sys::fs::F_None);
376376 if (!Error.empty()) {
377377 errs() << ToolName << ": warning: " << Error << '\n';
378378 return;
111111 OutputFilename = "-";
112112
113113 std::string ErrorInfo;
114 raw_fd_ostream Output(OutputFilename.data(), ErrorInfo);
114 raw_fd_ostream Output(OutputFilename.data(), ErrorInfo, sys::fs::F_None);
115115 if (!ErrorInfo.empty())
116116 exitWithError(ErrorInfo, OutputFilename);
117117