14#include "llvm/ADT/SmallVector.h"
15#include "llvm/ADT/StringSwitch.h"
16#include "llvm/Option/ArgList.h"
17#include "llvm/Support/Regex.h"
18#include "llvm/TargetParser/Host.h"
28 if (Arg *A = Args.getLastArg(clang::driver::options::OPT_mcpu_EQ)) {
31 StringRef CPUName = A->getValue();
33 if (CPUName ==
"native") {
34 std::string CPU = std::string(llvm::sys::getHostCPUName());
35 if (!CPU.empty() && CPU !=
"generic")
39 if (CPUName ==
"common")
42 return llvm::StringSwitch<std::string>(CPUName)
43 .Cases(
"m68000",
"68000",
"M68000")
44 .Cases(
"m68010",
"68010",
"M68010")
45 .Cases(
"m68020",
"68020",
"M68020")
46 .Cases(
"m68030",
"68030",
"M68030")
47 .Cases(
"m68040",
"68040",
"M68040")
48 .Cases(
"m68060",
"68060",
"M68060")
49 .Default(CPUName.str());
52 if (Args.hasArg(clang::driver::options::OPT_m68000))
54 if (Args.hasArg(clang::driver::options::OPT_m68010))
56 if (Args.hasArg(clang::driver::options::OPT_m68020))
58 if (Args.hasArg(clang::driver::options::OPT_m68030))
60 if (Args.hasArg(clang::driver::options::OPT_m68040))
62 if (Args.hasArg(clang::driver::options::OPT_m68060))
69 std::vector<llvm::StringRef> &Features) {
70 Arg *A = Args.getLastArg(options::OPT_msoft_float, options::OPT_mhard_float,
73 if (A && A->getOption().matches(options::OPT_msoft_float)) {
74 Features.push_back(
"-isa-68881");
75 Features.push_back(
"-isa-68882");
81 if ((A && (CPU ==
"M68000" || CPU ==
"M68010")) ||
84 Features.push_back(
"+isa-68881");
85 else if (CPU ==
"M68030" || CPU ==
"M68040" || CPU ==
"M68060")
90 Features.push_back(
"+isa-68882");
95 std::vector<StringRef> &Features) {
99 if (Args.hasArg(options::OPT_ffixed_a0))
100 Features.push_back(
"+reserve-a0");
101 if (Args.hasArg(options::OPT_ffixed_a1))
102 Features.push_back(
"+reserve-a1");
103 if (Args.hasArg(options::OPT_ffixed_a2))
104 Features.push_back(
"+reserve-a2");
105 if (Args.hasArg(options::OPT_ffixed_a3))
106 Features.push_back(
"+reserve-a3");
107 if (Args.hasArg(options::OPT_ffixed_a4))
108 Features.push_back(
"+reserve-a4");
109 if (Args.hasArg(options::OPT_ffixed_a5))
110 Features.push_back(
"+reserve-a5");
111 if (Args.hasArg(options::OPT_ffixed_a6))
112 Features.push_back(
"+reserve-a6");
113 if (Args.hasArg(options::OPT_ffixed_d0))
114 Features.push_back(
"+reserve-d0");
115 if (Args.hasArg(options::OPT_ffixed_d1))
116 Features.push_back(
"+reserve-d1");
117 if (Args.hasArg(options::OPT_ffixed_d2))
118 Features.push_back(
"+reserve-d2");
119 if (Args.hasArg(options::OPT_ffixed_d3))
120 Features.push_back(
"+reserve-d3");
121 if (Args.hasArg(options::OPT_ffixed_d4))
122 Features.push_back(
"+reserve-d4");
123 if (Args.hasArg(options::OPT_ffixed_d5))
124 Features.push_back(
"+reserve-d5");
125 if (Args.hasArg(options::OPT_ffixed_d6))
126 Features.push_back(
"+reserve-d6");
127 if (Args.hasArg(options::OPT_ffixed_d7))
128 Features.push_back(
"+reserve-d7");
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
The JSON file list parser is used to communicate input to InstallAPI.