Index: lib/Driver/ToolChains/Clang.cpp =================================================================== --- lib/Driver/ToolChains/Clang.cpp +++ lib/Driver/ToolChains/Clang.cpp @@ -273,21 +273,6 @@ OutStrings.push_back(Args.MakeArgString(Out)); } -static void getHexagonTargetFeatures(const ArgList &Args, - std::vector &Features) { - handleTargetFeaturesGroup(Args, Features, - options::OPT_m_hexagon_Features_Group); - - bool UseLongCalls = false; - if (Arg *A = Args.getLastArg(options::OPT_mlong_calls, - options::OPT_mno_long_calls)) { - if (A->getOption().matches(options::OPT_mlong_calls)) - UseLongCalls = true; - } - - Features.push_back(UseLongCalls ? "+long-calls" : "-long-calls"); -} - static void getWebAssemblyTargetFeatures(const ArgList &Args, std::vector &Features) { handleTargetFeaturesGroup(Args, Features, options::OPT_m_wasm_Features_Group); @@ -349,7 +334,7 @@ x86::getX86TargetFeatures(D, Triple, Args, Features); break; case llvm::Triple::hexagon: - getHexagonTargetFeatures(Args, Features); + hexagon::getHexagonTargetFeatures(Args, Features); break; case llvm::Triple::wasm32: case llvm::Triple::wasm64: Index: lib/Driver/ToolChains/Hexagon.h =================================================================== --- lib/Driver/ToolChains/Hexagon.h +++ lib/Driver/ToolChains/Hexagon.h @@ -50,6 +50,10 @@ const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; + +void getHexagonTargetFeatures(const llvm::opt::ArgList &Args, + std::vector &Features); + } // end namespace hexagon. } // end namespace tools Index: lib/Driver/ToolChains/Hexagon.cpp =================================================================== --- lib/Driver/ToolChains/Hexagon.cpp +++ lib/Driver/ToolChains/Hexagon.cpp @@ -27,6 +27,22 @@ using namespace clang; using namespace llvm::opt; +// Hexagon target features. +void hexagon::getHexagonTargetFeatures(const ArgList &Args, + std::vector &Features) { + handleTargetFeaturesGroup(Args, Features, + options::OPT_m_hexagon_Features_Group); + + bool UseLongCalls = false; + if (Arg *A = Args.getLastArg(options::OPT_mlong_calls, + options::OPT_mno_long_calls)) { + if (A->getOption().matches(options::OPT_mlong_calls)) + UseLongCalls = true; + } + + Features.push_back(UseLongCalls ? "+long-calls" : "-long-calls"); +} + // Hexagon tools start. void hexagon::Assembler::RenderExtraToolArgs(const JobAction &JA, ArgStringList &CmdArgs) const {