]> granicus.if.org Git - clang/commitdiff
Pulls diagnostics for temp file handling into the common diagnostic kinds.
authorManuel Klimek <klimek@google.com>
Wed, 16 May 2012 20:55:58 +0000 (20:55 +0000)
committerManuel Klimek <klimek@google.com>
Wed, 16 May 2012 20:55:58 +0000 (20:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156947 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticCommonKinds.td
include/clang/Basic/DiagnosticDriverKinds.td
include/clang/Basic/DiagnosticFrontendKinds.td
lib/Driver/Driver.cpp
lib/Frontend/CompilerInstance.cpp

index ef0232e63d17dadf94dee691478fc984560580ef..f85928740b4c65d9d1a4199d33b8fcef217b475d 100644 (file)
@@ -108,4 +108,8 @@ def err_file_modified : Error<
   "file '%0' modified since it was first processed">, DefaultFatal;
 def err_unsupported_bom : Error<"%0 byte order mark detected in '%1', but "
   "encoding is not supported">, DefaultFatal;
+def err_unable_to_rename_temp : Error<
+  "unable to rename temporary '%0' to output file '%1': '%2'">;
+def err_unable_to_make_temp : Error<
+  "unable to make temporary file: %0">;
 }
index b44315932c6bd6a03554647b1b89c7d5534b5578..7d20c610bb66bcba91e0accc384c17a624a7b9af 100644 (file)
@@ -33,8 +33,6 @@ def err_drv_use_of_Z_option : Error<
   "unsupported use of internal gcc -Z option '%0'">;
 def err_drv_output_argument_with_multiple_files : Error<
   "cannot specify -o when generating multiple output files">;
-def err_drv_unable_to_make_temp : Error<
-  "unable to make temporary file: %0">;
 def err_drv_unable_to_remove_file : Error<
   "unable to remove file: %0">;
 def err_drv_command_failure : Error<
index 5e44ddfe04ac011370a11b76f8527b81c0055f1e..8192d0ae7e4c48dd3bf632dd66bbc9f7dc0a331a 100644 (file)
@@ -48,8 +48,6 @@ def err_fe_unable_to_interface_with_target : Error<
     "unable to interface with target machine">;
 def err_fe_unable_to_open_output : Error<
     "unable to open output file '%0': '%1'">;
-def err_fe_unable_to_rename_temp : Error<
-    "unable to rename temporary '%0' to output file '%1': '%2'">;
 def err_fe_unable_to_open_logfile : Error<
     "unable to open logfile file '%0': '%1'">;
 def err_fe_pth_file_has_no_source_header : Error<
index 872be32b79b8797c40868536f6402254a723b0db..9340ba10e50da485e89843f67b78d9c2330706b6 100644 (file)
@@ -1635,7 +1635,7 @@ std::string Driver::GetTemporaryPath(StringRef Prefix, const char *Suffix)
   llvm::sys::Path P(TmpDir);
   P.appendComponent(Prefix);
   if (P.makeUnique(false, &Error)) {
-    Diag(clang::diag::err_drv_unable_to_make_temp) << Error;
+    Diag(clang::diag::err_unable_to_make_temp) << Error;
     return "";
   }
 
index c5b6a8f79c90eb44a2dd0f02f332ecc8087c9192..cd24a692b4cddd63188551b704c44673c4744050 100644 (file)
@@ -456,7 +456,7 @@ void CompilerInstance::clearOutputFiles(bool EraseFiles) {
         FileMgr->FixupRelativePath(NewOutFile);
         if (llvm::error_code ec = llvm::sys::fs::rename(it->TempFilename,
                                                         NewOutFile.str())) {
-          getDiagnostics().Report(diag::err_fe_unable_to_rename_temp)
+          getDiagnostics().Report(diag::err_unable_to_rename_temp)
             << it->TempFilename << it->Filename << ec.message();
 
           bool existed;