13#include "llvm/ADT/StringSwitch.h" 
   14#include "llvm/Option/ArgList.h" 
   15#include "llvm/TargetParser/Host.h" 
   23  return llvm::StringSwitch<const char *>(Name)
 
   24      .Case(
"pwr7", 
"-mpower7")
 
   25      .Case(
"power7", 
"-mpower7")
 
   26      .Case(
"pwr8", 
"-mpower8")
 
   27      .Case(
"power8", 
"-mpower8")
 
   28      .Case(
"ppc64le", 
"-mpower8")
 
   29      .Case(
"pwr9", 
"-mpower9")
 
   30      .Case(
"power9", 
"-mpower9")
 
   31      .Case(
"pwr10", 
"-mpower10")
 
   32      .Case(
"power10", 
"-mpower10")
 
   33      .Case(
"pwr11", 
"-mpower11")
 
   34      .Case(
"power11", 
"-mpower11")
 
 
   40                               std::vector<StringRef> &Features) {
 
   41  if (Triple.getSubArch() == llvm::Triple::PPCSubArch_spe)
 
   42    Features.push_back(
"+spe");
 
   45                            options::OPT_m_ppc_Features_Group);
 
   49    Features.push_back(
"-hard-float");
 
   53    Features.push_back(
"+secure-plt");
 
   56  bool HasDefaultDataSections = Triple.isOSBinFormatXCOFF();
 
   57  if (Args.hasArg(options::OPT_maix_small_local_exec_tls) ||
 
   58      Args.hasArg(options::OPT_maix_small_local_dynamic_tls)) {
 
   59    if (!Triple.isOSAIX() || !Triple.isArch64Bit())
 
   60      D.
Diag(diag::err_opt_not_valid_on_target)
 
   61          << 
"-maix-small-local-[exec|dynamic]-tls";
 
   68    if (!Args.hasFlag(options::OPT_fdata_sections,
 
   69                      options::OPT_fno_data_sections,
 
   70                      UseSeparateSections || HasDefaultDataSections))
 
   71      D.
Diag(diag::err_drv_argument_only_allowed_with)
 
   72          << 
"-maix-small-local-[exec|dynamic]-tls" << 
"-fdata-sections";
 
   75  if (Args.hasArg(options::OPT_maix_shared_lib_tls_model_opt) &&
 
   76      !(Triple.isOSAIX() && Triple.isArch64Bit()))
 
   77    D.
Diag(diag::err_opt_not_valid_on_target)
 
   78        << 
"-maix-shared-lib-tls-model-opt";
 
   82                                              const ArgList &Args) {
 
   83  if (Args.getLastArg(options::OPT_msecure_plt))
 
   85  if (Triple.isPPC32SecurePlt())
 
   94          Args.getLastArg(options::OPT_msoft_float, options::OPT_mhard_float,
 
   95                          options::OPT_mfloat_abi_EQ)) {
 
   96    if (A->getOption().matches(options::OPT_msoft_float))
 
   98    else if (A->getOption().matches(options::OPT_mhard_float))
 
  101      ABI = llvm::StringSwitch<ppc::FloatABI>(A->getValue())
 
  106        D.
Diag(clang::diag::err_drv_invalid_mfloat_abi) << A->getAsString(Args);
 
  121  Arg *A = Args.getLastArg(options::OPT_mabi_EQ);
 
  122  return A && (A->getValue() == StringRef(
Value));
 
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
DiagnosticBuilder Diag(unsigned DiagID) const
The JSON file list parser is used to communicate input to InstallAPI.