[cfe-commits] [PATCH] Pulls diagnostics for temp file handling into the common diagnostic kinds

Douglas Gregor dgregor at apple.com
Wed May 16 13:41:40 PDT 2012


LGTM

On May 16, 2012, at 1:32 PM, Manuel Klimek <klimek at google.com> wrote:

> As suggested on irc:
> 
> Index: include/clang/Basic/DiagnosticDriverKinds.td
> ===================================================================
> --- include/clang/Basic/DiagnosticDriverKinds.td        (revision 156808)
> +++ include/clang/Basic/DiagnosticDriverKinds.td        (working copy)
> @@ -33,8 +33,6 @@
>   "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: include/clang/Basic/DiagnosticFrontendKinds.td
> ===================================================================
> --- include/clang/Basic/DiagnosticFrontendKinds.td      (revision 156808)
> +++ include/clang/Basic/DiagnosticFrontendKinds.td      (working copy)
> @@ -48,8 +48,6 @@
>     "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: include/clang/Basic/DiagnosticCommonKinds.td
> ===================================================================
> --- include/clang/Basic/DiagnosticCommonKinds.td        (revision 156808)
> +++ include/clang/Basic/DiagnosticCommonKinds.td        (working copy)
> @@ -108,4 +108,8 @@
>   "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: lib/Frontend/CompilerInstance.cpp
> ===================================================================
> --- lib/Frontend/CompilerInstance.cpp   (revision 156808)
> +++ lib/Frontend/CompilerInstance.cpp   (working copy)
> @@ -456,7 +456,7 @@
>         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;
> Index: lib/Driver/Driver.cpp
> ===================================================================
> --- lib/Driver/Driver.cpp       (revision 156808)
> +++ lib/Driver/Driver.cpp       (working copy)
> @@ -1635,7 +1635,7 @@
>   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 "";
>   }
> <diags.patch>




More information about the cfe-commits mailing list