//===- DiagnosticsDriver.def - Diagnostics Text -----------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
//  This file defines driver-only diagnostics emitted in processing
//  command-line arguments and setting up compilation.
//  Each diagnostic is described using one of three kinds (error, warning, or 
//  note) along with a unique identifier, category, options, and text, and is
//  followed by a signature describing the diagnostic argument kinds.
//
//===----------------------------------------------------------------------===//

#if !(defined(DIAG) || (defined(ERROR) && defined(WARNING) && defined(NOTE)))
#  error Must define either DIAG or the set {ERROR,WARNING,NOTE}
#endif

#ifndef ERROR
#  define ERROR(ID,Category,Options,Text,Signature)   \
  DIAG(ERROR,ID,Category,Options,Text,Signature)
#endif

#ifndef WARNING
#  define WARNING(ID,Category,Options,Text,Signature) \
  DIAG(WARNING,ID,Category,Options,Text,Signature)
#endif

#ifndef NOTE
#  define NOTE(ID,Category,Options,Text,Signature) \
  DIAG(NOTE,ID,Category,Options,Text,Signature)
#endif


WARNING(warning_parallel_execution_not_supported,driver,none,
        "parallel execution not supported; falling back to serial execution",
        ())

ERROR(error_unable_to_execute_command,driver,none,
      "unable to execute command: %0", (StringRef))
ERROR(error_command_signalled,driver,none,
      "%0 command failed due to signal (use -v to see invocation)", (StringRef))
ERROR(error_command_failed,driver,none,
      "%0 command failed with exit code %1 (use -v to see invocation)",
      (StringRef, int))

ERROR(error_expected_one_frontend_job,driver,none,
      "unable to handle compilation, expected exactly one frontend job", ())
ERROR(error_expected_frontend_command,driver,none,
      "expected a swift frontend command", ())

ERROR(error_cannot_specify__o_for_multiple_outputs,driver,none,
      "cannot specify -o when generating multiple output files", ())

ERROR(error_unable_to_load_output_file_map,driver, none,
      "unable to load output file map", ())

ERROR(error_no_output_file_map_specified,driver,none,
      "no output file map specified", ())

ERROR(error_unable_to_make_temporary_file,driver,none,
      "unable to make temporary file: %0", (StringRef))

ERROR(error_no_input_files,driver,none,
      "no input files", ())

ERROR(error_unexpected_input_file,driver,none,
      "unexpected input file: %0", (StringRef))

ERROR(error_unknown_target,driver,none,
      "unknown target '%0'", (StringRef))

ERROR(error_framework_bridging_header,driver,none,
      "using bridging headers with framework targets is unsupported", ())

ERROR(error_i_mode,driver,none,
      "the flag '-i' is no longer required and has been removed; "
      "use '%0 input-filename'", (StringRef))
WARNING(warning_unnecessary_repl_mode,driver,none,
        "unnecessary option '%0'; this is the default for '%1' "
        "with no input files", (StringRef, StringRef))
ERROR(error_unsupported_option,driver,none,
      "unsupported option '%0' for '%1'; did you mean '%2 %0'?",
      (StringRef, StringRef, StringRef))

WARNING(incremental_requires_output_file_map,driver,none,
        "ignoring -incremental (currently requires an output file map)", ())
WARNING(incremental_requires_build_record_entry,driver,none,
        "ignoring -incremental; output file map has no master dependencies "
        "entry (\"%0\" under \"\")", (StringRef))

ERROR(error_os_minimum_deployment,driver,none,
      "Swift requires a minimum deployment target of %0", (StringRef))
ERROR(error_sdk_too_old,driver,none,
      "Swift does not support the SDK '%0'", (StringRef))

ERROR(error_two_files_same_name,driver,none,
      "filename \"%0\" used twice: '%1' and '%2'",
      (StringRef, StringRef, StringRef))
NOTE(note_explain_two_files_same_name,driver,none,
     "filenames are used to distinguish private declarations with the same "
     "name", ())

WARNING(warn_cannot_stat_input,driver,none,
        "unable to determine when '%0' was last modified: %1",
        (StringRef, StringRef))

ERROR(error_input_changed_during_build,driver,none,
      "input file '%0' was modified during the build",
      (StringRef))

#ifndef DIAG_NO_UNDEF
# if defined(DIAG)
#  undef DIAG
# endif
# undef NOTE
# undef WARNING
# undef ERROR
#endif
