|
@@ -2601,6 +2601,33 @@ static void RenderModulesOptions(Compilation &C, const Driver &D,
|
|
Args.AddLastArg(CmdArgs, options::OPT_fmodules_disable_diagnostic_validation);
|
|
Args.AddLastArg(CmdArgs, options::OPT_fmodules_disable_diagnostic_validation);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void RenderCharacterOptions(const ArgList &Args, const llvm::Triple &T,
|
|
|
|
+ ArgStringList &CmdArgs) {
|
|
|
|
+ // -fsigned-char is default.
|
|
|
|
+ if (const Arg *A = Args.getLastArg(options::OPT_fsigned_char,
|
|
|
|
+ options::OPT_fno_signed_char,
|
|
|
|
+ options::OPT_funsigned_char,
|
|
|
|
+ options::OPT_fno_unsigned_char)) {
|
|
|
|
+ if (A->getOption().matches(options::OPT_funsigned_char) ||
|
|
|
|
+ A->getOption().matches(options::OPT_fno_signed_char)) {
|
|
|
|
+ CmdArgs.push_back("-fno-signed-char");
|
|
|
|
+ }
|
|
|
|
+ } else if (!isSignedCharDefault(T)) {
|
|
|
|
+ CmdArgs.push_back("-fno-signed-char");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (const Arg *A = Args.getLastArg(options::OPT_fshort_wchar,
|
|
|
|
+ options::OPT_fno_short_wchar)) {
|
|
|
|
+ if (A->getOption().matches(options::OPT_fshort_wchar)) {
|
|
|
|
+ CmdArgs.push_back("-fwchar-type=short");
|
|
|
|
+ CmdArgs.push_back("-fno-signed-wchar");
|
|
|
|
+ } else {
|
|
|
|
+ CmdArgs.push_back("-fwchar-type=int");
|
|
|
|
+ CmdArgs.push_back("-fsigned-wchar");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
static void RenderObjCOptions(const ToolChain &TC, const Driver &D,
|
|
static void RenderObjCOptions(const ToolChain &TC, const Driver &D,
|
|
const llvm::Triple &T, const ArgList &Args,
|
|
const llvm::Triple &T, const ArgList &Args,
|
|
ObjCRuntime &Runtime, bool InferCovariantReturns,
|
|
ObjCRuntime &Runtime, bool InferCovariantReturns,
|
|
@@ -2991,6 +3018,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|
Inputs.size() == 1) &&
|
|
Inputs.size() == 1) &&
|
|
"Unable to handle multiple inputs.");
|
|
"Unable to handle multiple inputs.");
|
|
|
|
|
|
|
|
+ const llvm::Triple *AuxTriple =
|
|
|
|
+ IsCuda ? getToolChain().getAuxTriple() : nullptr;
|
|
|
|
+
|
|
bool IsWindowsGNU = RawTriple.isWindowsGNUEnvironment();
|
|
bool IsWindowsGNU = RawTriple.isWindowsGNUEnvironment();
|
|
bool IsWindowsCygnus = RawTriple.isWindowsCygwinEnvironment();
|
|
bool IsWindowsCygnus = RawTriple.isWindowsCygwinEnvironment();
|
|
bool IsWindowsMSVC = RawTriple.isWindowsMSVCEnvironment();
|
|
bool IsWindowsMSVC = RawTriple.isWindowsMSVCEnvironment();
|
|
@@ -3000,7 +3030,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|
// mode (i.e., getToolchain().getTriple() is NVPTX, not Windows), we need to
|
|
// mode (i.e., getToolchain().getTriple() is NVPTX, not Windows), we need to
|
|
// pass Windows-specific flags to cc1.
|
|
// pass Windows-specific flags to cc1.
|
|
if (IsCuda) {
|
|
if (IsCuda) {
|
|
- const llvm::Triple *AuxTriple = getToolChain().getAuxTriple();
|
|
|
|
IsWindowsMSVC |= AuxTriple && AuxTriple->isWindowsMSVCEnvironment();
|
|
IsWindowsMSVC |= AuxTriple && AuxTriple->isWindowsMSVCEnvironment();
|
|
IsWindowsGNU |= AuxTriple && AuxTriple->isWindowsGNUEnvironment();
|
|
IsWindowsGNU |= AuxTriple && AuxTriple->isWindowsGNUEnvironment();
|
|
IsWindowsCygnus |= AuxTriple && AuxTriple->isWindowsCygwinEnvironment();
|
|
IsWindowsCygnus |= AuxTriple && AuxTriple->isWindowsCygwinEnvironment();
|
|
@@ -4003,17 +4032,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|
getToolChain().getArch() == llvm::Triple::hexagon))
|
|
getToolChain().getArch() == llvm::Triple::hexagon))
|
|
CmdArgs.push_back("-fshort-enums");
|
|
CmdArgs.push_back("-fshort-enums");
|
|
|
|
|
|
- // -fsigned-char is default.
|
|
|
|
- if (Arg *A = Args.getLastArg(
|
|
|
|
- options::OPT_fsigned_char, options::OPT_fno_signed_char,
|
|
|
|
- options::OPT_funsigned_char, options::OPT_fno_unsigned_char)) {
|
|
|
|
- if (A->getOption().matches(options::OPT_funsigned_char) ||
|
|
|
|
- A->getOption().matches(options::OPT_fno_signed_char)) {
|
|
|
|
- CmdArgs.push_back("-fno-signed-char");
|
|
|
|
- }
|
|
|
|
- } else if (!isSignedCharDefault(RawTriple)) {
|
|
|
|
- CmdArgs.push_back("-fno-signed-char");
|
|
|
|
- }
|
|
|
|
|
|
+ RenderCharacterOptions(Args, AuxTriple ? *AuxTriple : RawTriple, CmdArgs);
|
|
|
|
|
|
// -fuse-cxa-atexit is default.
|
|
// -fuse-cxa-atexit is default.
|
|
if (!Args.hasFlag(
|
|
if (!Args.hasFlag(
|
|
@@ -4182,12 +4201,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|
options::OPT_mno_constant_cfstrings))
|
|
options::OPT_mno_constant_cfstrings))
|
|
CmdArgs.push_back("-fno-constant-cfstrings");
|
|
CmdArgs.push_back("-fno-constant-cfstrings");
|
|
|
|
|
|
- // -fshort-wchar default varies depending on platform; only
|
|
|
|
- // pass if specified.
|
|
|
|
- if (Arg *A = Args.getLastArg(options::OPT_fshort_wchar,
|
|
|
|
- options::OPT_fno_short_wchar))
|
|
|
|
- A->render(Args, CmdArgs);
|
|
|
|
-
|
|
|
|
// -fno-pascal-strings is default, only pass non-default.
|
|
// -fno-pascal-strings is default, only pass non-default.
|
|
if (Args.hasFlag(options::OPT_fpascal_strings,
|
|
if (Args.hasFlag(options::OPT_fpascal_strings,
|
|
options::OPT_fno_pascal_strings, false))
|
|
options::OPT_fno_pascal_strings, false))
|