[llvm] r202042 - Don't make F_None the default.

Rafael Espindola rafael.espindola at gmail.com
Mon Feb 24 07:07:21 PST 2014


Author: rafael
Date: Mon Feb 24 09:07:20 2014
New Revision: 202042

URL: http://llvm.org/viewvc/llvm-project?rev=202042&view=rev
Log:
Don't make F_None the default.

This will make it easier to switch the default to being binary files.

Modified:
    llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h
    llvm/trunk/include/llvm/Support/ToolOutputFile.h
    llvm/trunk/include/llvm/Support/raw_ostream.h
    llvm/trunk/lib/Analysis/CFGPrinter.cpp
    llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp
    llvm/trunk/lib/IR/Core.cpp
    llvm/trunk/lib/IR/GCOV.cpp
    llvm/trunk/lib/TableGen/Main.cpp
    llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp
    llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
    llvm/trunk/tools/llvm-profdata/llvm-profdata.cpp

Modified: llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h?rev=202042&r1=202041&r2=202042&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h (original)
+++ llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h Mon Feb 24 09:07:20 2014
@@ -69,7 +69,7 @@ public:
 
     errs() << "Writing '" << Filename << "'...";
 
-    raw_fd_ostream File(Filename.c_str(), ErrorInfo);
+    raw_fd_ostream File(Filename.c_str(), ErrorInfo, sys::fs::F_None);
     std::string GraphName = DOTGraphTraits<GraphT>::getGraphName(Graph);
     std::string Title = GraphName + " for '" + F.getName().str() + "' function";
 
@@ -132,7 +132,7 @@ public:
 
     errs() << "Writing '" << Filename << "'...";
 
-    raw_fd_ostream File(Filename.c_str(), ErrorInfo);
+    raw_fd_ostream File(Filename.c_str(), ErrorInfo, sys::fs::F_None);
     std::string Title = DOTGraphTraits<GraphT>::getGraphName(Graph);
 
     if (ErrorInfo.empty())

Modified: llvm/trunk/include/llvm/Support/ToolOutputFile.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ToolOutputFile.h?rev=202042&r1=202041&r2=202042&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/ToolOutputFile.h (original)
+++ llvm/trunk/include/llvm/Support/ToolOutputFile.h Mon Feb 24 09:07:20 2014
@@ -47,7 +47,7 @@ public:
   /// tool_output_file - This constructor's arguments are passed to
   /// to raw_fd_ostream's constructor.
   tool_output_file(const char *filename, std::string &ErrorInfo,
-                   sys::fs::OpenFlags Flags = sys::fs::F_None);
+                   sys::fs::OpenFlags Flags);
 
   tool_output_file(const char *Filename, int FD);
 

Modified: llvm/trunk/include/llvm/Support/raw_ostream.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/raw_ostream.h?rev=202042&r1=202041&r2=202042&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/raw_ostream.h (original)
+++ llvm/trunk/include/llvm/Support/raw_ostream.h Mon Feb 24 09:07:20 2014
@@ -347,7 +347,7 @@ public:
   /// file descriptor when it is done (this is necessary to detect
   /// output errors).
   raw_fd_ostream(const char *Filename, std::string &ErrorInfo,
-                 sys::fs::OpenFlags Flags = sys::fs::F_None);
+                 sys::fs::OpenFlags Flags);
 
   /// raw_fd_ostream ctor - FD is the file descriptor that this writes to.  If
   /// ShouldClose is true, this closes the file when the stream is destroyed.

Modified: llvm/trunk/lib/Analysis/CFGPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CFGPrinter.cpp?rev=202042&r1=202041&r2=202042&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/CFGPrinter.cpp (original)
+++ llvm/trunk/lib/Analysis/CFGPrinter.cpp Mon Feb 24 09:07:20 2014
@@ -80,7 +80,7 @@ namespace {
       errs() << "Writing '" << Filename << "'...";
       
       std::string ErrorInfo;
-      raw_fd_ostream File(Filename.c_str(), ErrorInfo);
+      raw_fd_ostream File(Filename.c_str(), ErrorInfo, sys::fs::F_None);
 
       if (ErrorInfo.empty())
         WriteGraph(File, (const Function*)&F);
@@ -114,7 +114,7 @@ namespace {
       errs() << "Writing '" << Filename << "'...";
 
       std::string ErrorInfo;
-      raw_fd_ostream File(Filename.c_str(), ErrorInfo);
+      raw_fd_ostream File(Filename.c_str(), ErrorInfo, sys::fs::F_None);
       
       if (ErrorInfo.empty())
         WriteGraph(File, (const Function*)&F, true);

Modified: llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp?rev=202042&r1=202041&r2=202042&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp Mon Feb 24 09:07:20 2014
@@ -595,7 +595,7 @@ bool RegAllocPBQP::runOnMachineFunction(
         rs << round;
         std::string graphFileName(fqn + "." + rs.str() + ".pbqpgraph");
         std::string tmp;
-        raw_fd_ostream os(graphFileName.c_str(), tmp);
+        raw_fd_ostream os(graphFileName.c_str(), tmp, sys::fs::F_None);
         DEBUG(dbgs() << "Dumping graph for round " << round << " to \""
               << graphFileName << "\"\n");
         problem->getGraph().dump(os);

Modified: llvm/trunk/lib/IR/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Core.cpp?rev=202042&r1=202041&r2=202042&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Core.cpp (original)
+++ llvm/trunk/lib/IR/Core.cpp Mon Feb 24 09:07:20 2014
@@ -130,7 +130,7 @@ void LLVMDumpModule(LLVMModuleRef M) {
 LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename,
                                char **ErrorMessage) {
   std::string error;
-  raw_fd_ostream dest(Filename, error);
+  raw_fd_ostream dest(Filename, error, sys::fs::F_None);
   if (!error.empty()) {
     *ErrorMessage = strdup(error.c_str());
     return true;

Modified: llvm/trunk/lib/IR/GCOV.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/GCOV.cpp?rev=202042&r1=202041&r2=202042&view=diff
==============================================================================
--- llvm/trunk/lib/IR/GCOV.cpp (original)
+++ llvm/trunk/lib/IR/GCOV.cpp Mon Feb 24 09:07:20 2014
@@ -482,7 +482,7 @@ void FileInfo::print(StringRef GCNOFile,
     std::string CoveragePath = mangleCoveragePath(Filename,
                                                   Options.PreservePaths);
     std::string ErrorInfo;
-    raw_fd_ostream OS(CoveragePath.c_str(), ErrorInfo);
+    raw_fd_ostream OS(CoveragePath.c_str(), ErrorInfo, sys::fs::F_None);
     if (!ErrorInfo.empty())
       errs() << ErrorInfo << "\n";
 

Modified: llvm/trunk/lib/TableGen/Main.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/Main.cpp?rev=202042&r1=202041&r2=202042&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/Main.cpp (original)
+++ llvm/trunk/lib/TableGen/Main.cpp Mon Feb 24 09:07:20 2014
@@ -57,7 +57,7 @@ static int createDependencyFile(const TG
     return 1;
   }
   std::string Error;
-  tool_output_file DepOut(DependFilename.c_str(), Error);
+  tool_output_file DepOut(DependFilename.c_str(), Error, sys::fs::F_None);
   if (!Error.empty()) {
     errs() << argv0 << ": error opening " << DependFilename
       << ":" << Error << "\n";
@@ -103,7 +103,7 @@ int TableGenMain(char *argv0, TableGenMa
     return 1;
 
   std::string Error;
-  tool_output_file Out(OutputFilename.c_str(), Error);
+  tool_output_file Out(OutputFilename.c_str(), Error, sys::fs::F_None);
   if (!Error.empty()) {
     errs() << argv0 << ": error opening " << OutputFilename
       << ":" << Error << "\n";

Modified: llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp?rev=202042&r1=202041&r2=202042&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp Mon Feb 24 09:07:20 2014
@@ -528,7 +528,7 @@ void DebugIR::writeDebugBitcode(const Mo
 
   if (!fd) {
     std::string Path = getPath();
-    Out.reset(new raw_fd_ostream(Path.c_str(), error));
+    Out.reset(new raw_fd_ostream(Path.c_str(), error, sys::fs::F_None));
     DEBUG(dbgs() << "WRITING debug bitcode from Module " << M << " to file "
                  << Path << "\n");
   } else {

Modified: llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp?rev=202042&r1=202041&r2=202042&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp Mon Feb 24 09:07:20 2014
@@ -192,7 +192,7 @@ static void emitDOTFile(const char *File
                         MCInstPrinter *IP) {
   // Start a new dot file.
   std::string Error;
-  raw_fd_ostream Out(FileName, Error);
+  raw_fd_ostream Out(FileName, Error, sys::fs::F_None);
   if (!Error.empty()) {
     errs() << "llvm-objdump: warning: " << Error << '\n';
     return;
@@ -373,7 +373,7 @@ static void DisassembleObject(const Obje
     }
     if (!YAMLCFG.empty()) {
       std::string Error;
-      raw_fd_ostream YAMLOut(YAMLCFG.c_str(), Error);
+      raw_fd_ostream YAMLOut(YAMLCFG.c_str(), Error, sys::fs::F_None);
       if (!Error.empty()) {
         errs() << ToolName << ": warning: " << Error << '\n';
         return;

Modified: llvm/trunk/tools/llvm-profdata/llvm-profdata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-profdata/llvm-profdata.cpp?rev=202042&r1=202041&r2=202042&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-profdata/llvm-profdata.cpp (original)
+++ llvm/trunk/tools/llvm-profdata/llvm-profdata.cpp Mon Feb 24 09:07:20 2014
@@ -112,7 +112,7 @@ int main(int argc, char **argv) {
     OutputFilename = "-";
 
   std::string ErrorInfo;
-  raw_fd_ostream Output(OutputFilename.data(), ErrorInfo);
+  raw_fd_ostream Output(OutputFilename.data(), ErrorInfo, sys::fs::F_None);
   if (!ErrorInfo.empty())
     exitWithError(ErrorInfo, OutputFilename);
 





More information about the llvm-commits mailing list