|| Args.hasArg(options::OPT_fpic);
}
-static Arg *GetLastSmallDataThresholdArg(const ArgList &Args) {
- return Args.getLastArg(options::OPT_G,
- options::OPT_G_EQ,
- options::OPT_msmall_data_threshold_EQ);
-}
-
-static std::string GetHexagonSmallDataThresholdValue(const ArgList &Args) {
- std::string value;
- if (HasPICArg(Args))
- value = "0";
- else if (Arg *A = GetLastSmallDataThresholdArg(Args)) {
- value = A->getValue();
- A->claim();
- }
- return value;
-}
-
void Clang::AddHexagonTargetArgs(const ArgList &Args,
ArgStringList &CmdArgs) const {
CmdArgs.push_back("-fno-signed-char");
CmdArgs.push_back("-mqdsp6-compat");
CmdArgs.push_back("-Wreturn-type");
- std::string SmallDataThreshold = GetHexagonSmallDataThresholdValue(Args);
- if (!SmallDataThreshold.empty()) {
+ if (const char* v = toolchains::Hexagon_TC::GetSmallDataThreshold(Args)) {
+ std::string SmallDataThreshold="-hexagon-small-data-threshold=";
+ SmallDataThreshold += v;
CmdArgs.push_back ("-mllvm");
- CmdArgs.push_back(Args.MakeArgString(
- "-hexagon-small-data-threshold=" + SmallDataThreshold));
+ CmdArgs.push_back(Args.MakeArgString(SmallDataThreshold));
}
if (!Args.hasArg(options::OPT_fno_short_enums))
CmdArgs.push_back("-fsyntax-only");
}
- std::string SmallDataThreshold = GetHexagonSmallDataThresholdValue(Args);
- if (!SmallDataThreshold.empty())
- CmdArgs.push_back(
- Args.MakeArgString(std::string("-G") + SmallDataThreshold));
+ if (const char* v = toolchains::Hexagon_TC::GetSmallDataThreshold(Args))
+ CmdArgs.push_back(Args.MakeArgString(std::string("-G") + v));
Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
options::OPT_Xassembler);
bool incStdLib = !Args.hasArg(options::OPT_nostdlib);
bool incStartFiles = !Args.hasArg(options::OPT_nostartfiles);
bool incDefLibs = !Args.hasArg(options::OPT_nodefaultlibs);
+ bool useG0 = false;
bool useShared = buildingLib && !hasStaticArg;
//----------------------------------------------------------------------------
if (buildPIE && !buildingLib)
CmdArgs.push_back("-pie");
- std::string SmallDataThreshold = GetHexagonSmallDataThresholdValue(Args);
- if (!SmallDataThreshold.empty()) {
- CmdArgs.push_back(
- Args.MakeArgString(std::string("-G") + SmallDataThreshold));
+ if (const char* v = toolchains::Hexagon_TC::GetSmallDataThreshold(Args)) {
+ CmdArgs.push_back(Args.MakeArgString(std::string("-G") + v));
+ useG0 = toolchains::Hexagon_TC::UsesG0(v);
}
//----------------------------------------------------------------------------
toolchains::Hexagon_TC::GetGnuDir(D.InstalledDir, Args) + "/";
const std::string StartFilesDir = RootDir
+ "hexagon/lib"
- + (buildingLib
- ? MarchG0Suffix : MarchSuffix);
+ + (useG0 ? MarchG0Suffix : MarchSuffix);
//----------------------------------------------------------------------------
// moslib
// RUN: --gcc-toolchain="" \
// RUN: -fpic \
// RUN: %s 2>&1 \
-// RUN: | FileCheck -check-prefix=CHECK024 %s
-// RUN: %clang -### -target hexagon-unknown-linux \
-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
-// RUN: --gcc-toolchain="" \
-// RUN: -fPIC \
-// RUN: %s 2>&1 \
-// RUN: | FileCheck -check-prefix=CHECK024 %s
+// RUN: | sed -e "s/\.exe//" -e "s/\.EXE//" | FileCheck -check-prefix=CHECK024 %s
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
// RUN: --gcc-toolchain="" \
// RUN: -fPIC \
-// RUN: -msmall-data-threshold=8 \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK024 %s
// CHECK024: "-cc1"