]> granicus.if.org Git - clang/commitdiff
Update for raw_fd_ostream API changes. raw_fd_ostream now has a
authorDan Gohman <gohman@apple.com>
Wed, 15 Jul 2009 17:32:18 +0000 (17:32 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 15 Jul 2009 17:32:18 +0000 (17:32 +0000)
Force flag to control whether the case of opening an existing
file is considered an error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75802 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/InheritViz.cpp
lib/Frontend/AnalysisConsumer.cpp
lib/Frontend/FixItRewriter.cpp
lib/Frontend/PlistDiagnostics.cpp
tools/clang-cc/clang-cc.cpp

index dd2fc14ab2a4cf5f8b617a63da760ca25e2f34b1..1188ba5860b4a8a785578e010115b58febf15df5 100644 (file)
@@ -149,7 +149,7 @@ void CXXRecordDecl::viewInheritance(ASTContext& Context) const {
 
   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);
index 06af2d9a4e58e01e6a2d605e7aa38330914d2852..6433bdf7a49dfd3b36940c824e1ddd1751c32171 100644 (file)
@@ -587,7 +587,8 @@ static ExplodedNodeImpl::Auditor* CreateUbiViz() {
   
   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;
index 1ed89d75a9c953de828d850ced58d1706ae50b23..cd7cee0f6847e5261409df2cf5383ff2339ff28d 100644 (file)
@@ -47,6 +47,7 @@ bool FixItRewriter::WriteFixedFile(const std::string &InFileName,
     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 @@ bool FixItRewriter::WriteFixedFile(const std::string &InFileName,
     OutFile = new llvm::raw_fd_ostream(Path.toString().c_str(), 
                                        // set binary mode (critical for Windoze)
                                        true, 
+                                       /*Force=*/true,
                                        Err);
     OwnedStream.reset(OutFile);
   }  
index 387ed45a9c7101b42a2e32f5403d0f56c409ae34..f3a954358ec314223567dca695340c7e162146c7 100644 (file)
@@ -319,7 +319,7 @@ PlistDiagnostics::~PlistDiagnostics() {
 
   // 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;
index 18bd884f0d75ac657e26935263435431d628687e..def46c2f7a1cf1e2f89153bc32416e7a29f95b8d 100644 (file)
@@ -1682,7 +1682,7 @@ static void SetUpBuildDumpLog(unsigned argc, char **argv,
   
   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 @@ static llvm::raw_ostream* ComputeOutFile(const std::string& InFile,
       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 @@ int main(int argc, char **argv) {
       }
       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;