[cfe-commits] r75802 - in /cfe/trunk: lib/AST/InheritViz.cpp lib/Frontend/AnalysisConsumer.cpp lib/Frontend/FixItRewriter.cpp lib/Frontend/PlistDiagnostics.cpp tools/clang-cc/clang-cc.cpp

Dan Gohman gohman at apple.com
Wed Jul 15 10:32:19 PDT 2009


Author: djg
Date: Wed Jul 15 12:32:18 2009
New Revision: 75802

URL: http://llvm.org/viewvc/llvm-project?rev=75802&view=rev
Log:
Update for raw_fd_ostream API changes. raw_fd_ostream now has a
Force flag to control whether the case of opening an existing
file is considered an error.

Modified:
    cfe/trunk/lib/AST/InheritViz.cpp
    cfe/trunk/lib/Frontend/AnalysisConsumer.cpp
    cfe/trunk/lib/Frontend/FixItRewriter.cpp
    cfe/trunk/lib/Frontend/PlistDiagnostics.cpp
    cfe/trunk/tools/clang-cc/clang-cc.cpp

Modified: cfe/trunk/lib/AST/InheritViz.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/InheritViz.cpp?rev=75802&r1=75801&r2=75802&view=diff

==============================================================================
--- cfe/trunk/lib/AST/InheritViz.cpp (original)
+++ cfe/trunk/lib/AST/InheritViz.cpp Wed Jul 15 12:32:18 2009
@@ -149,7 +149,7 @@
 
   llvm::errs() << "Writing '" << Filename.c_str() << "'... ";
 
-  llvm::raw_fd_ostream O(Filename.c_str(), false, ErrMsg);
+  llvm::raw_fd_ostream O(Filename.c_str(), false, /*Force=*/true, ErrMsg);
 
   if (ErrMsg.empty()) {
     InheritanceHierarchyWriter Writer(Context, O);

Modified: cfe/trunk/lib/Frontend/AnalysisConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/AnalysisConsumer.cpp?rev=75802&r1=75801&r2=75802&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/AnalysisConsumer.cpp (original)
+++ cfe/trunk/lib/Frontend/AnalysisConsumer.cpp Wed Jul 15 12:32:18 2009
@@ -587,7 +587,8 @@
   
   llvm::OwningPtr<llvm::raw_fd_ostream> Stream;
   std::string filename = Filename.toString();
-  Stream.reset(new llvm::raw_fd_ostream(filename.c_str(), false, ErrMsg));
+  Stream.reset(new llvm::raw_fd_ostream(filename.c_str(), false,
+                                        /*Force=*/true, ErrMsg));
 
   if (!ErrMsg.empty())
     return 0;

Modified: cfe/trunk/lib/Frontend/FixItRewriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/FixItRewriter.cpp?rev=75802&r1=75801&r2=75802&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/FixItRewriter.cpp (original)
+++ cfe/trunk/lib/Frontend/FixItRewriter.cpp Wed Jul 15 12:32:18 2009
@@ -47,6 +47,7 @@
     OutFile = new llvm::raw_fd_ostream(OutFileName.c_str(), 
                                        // set binary mode (critical for Windoze)
                                        true, 
+                                       /*Force=*/true,
                                        Err);
     OwnedStream.reset(OutFile);
   } else if (InFileName == "-") {
@@ -60,6 +61,7 @@
     OutFile = new llvm::raw_fd_ostream(Path.toString().c_str(), 
                                        // set binary mode (critical for Windoze)
                                        true, 
+                                       /*Force=*/true,
                                        Err);
     OwnedStream.reset(OutFile);
   }  

Modified: cfe/trunk/lib/Frontend/PlistDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PlistDiagnostics.cpp?rev=75802&r1=75801&r2=75802&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PlistDiagnostics.cpp (original)
+++ cfe/trunk/lib/Frontend/PlistDiagnostics.cpp Wed Jul 15 12:32:18 2009
@@ -319,7 +319,7 @@
 
   // Open the file.
   std::string ErrMsg;
-  llvm::raw_fd_ostream o(OutputFile.c_str(), false, ErrMsg);
+  llvm::raw_fd_ostream o(OutputFile.c_str(), false, /*Force=*/true, ErrMsg);
   if (!ErrMsg.empty()) {
     llvm::errs() << "warning: could not creat file: " << OutputFile << '\n';
     return;

Modified: cfe/trunk/tools/clang-cc/clang-cc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/clang-cc.cpp?rev=75802&r1=75801&r2=75802&view=diff

==============================================================================
--- cfe/trunk/tools/clang-cc/clang-cc.cpp (original)
+++ cfe/trunk/tools/clang-cc/clang-cc.cpp Wed Jul 15 12:32:18 2009
@@ -1682,7 +1682,7 @@
   
   std::string ErrorInfo;
   BuildLogFile = new llvm::raw_fd_ostream(DumpBuildInformation.c_str(), false,
-                                          ErrorInfo);
+                                          /*Force=*/true, ErrorInfo);
   
   if (!ErrorInfo.empty()) {
     llvm::errs() << "error opening -dump-build-information file '"
@@ -1735,7 +1735,8 @@
       llvm::sys::Program::ChangeStdoutToBinary();
   } else {
     std::string Error;
-    Ret = new llvm::raw_fd_ostream(OutFile.c_str(), Binary, Error);
+    Ret = new llvm::raw_fd_ostream(OutFile.c_str(), Binary,
+                                   /*Force=*/true, Error);
     if (!Error.empty()) {
       // FIXME: Don't fail this way.
       llvm::cerr << "ERROR: " << Error << "\n";
@@ -2276,7 +2277,8 @@
       }
       std::string ErrStr;
       DependencyOS =
-          new llvm::raw_fd_ostream(DependencyFile.c_str(), false, ErrStr);
+          new llvm::raw_fd_ostream(DependencyFile.c_str(), false,
+                                   /*Force=*/true, ErrStr);
       if (!ErrStr.empty()) {
         // FIXME: Use a proper diagnostic
         llvm::cerr << "unable to open dependency file: " + ErrStr;





More information about the cfe-commits mailing list