sgundapa created this revision. Repository: rL LLVM
https://reviews.llvm.org/D39071 Files: lib/Driver/ToolChains/Hexagon.cpp Index: lib/Driver/ToolChains/Hexagon.cpp =================================================================== --- lib/Driver/ToolChains/Hexagon.cpp +++ lib/Driver/ToolChains/Hexagon.cpp @@ -59,7 +59,8 @@ handleHVXWarnings(D, Args); // Add the +hvx* features based on commandline flags. - StringRef HVXFeature, HVXLength; + StringRef HVXFeature; + std::string HVXLength; StringRef Cpu(toolchains::HexagonToolChain::GetTargetCPUVersion(Args)); // Handle -mhvx, -mhvx=, -mno-hvx, -mno-hvx-double. @@ -87,17 +88,17 @@ if (!HasHVX) D.Diag(diag::err_drv_invalid_hvx_length); else if (A->getOption().matches(options::OPT_mhexagon_hvx_length_EQ)) - HVXLength = A->getValue(); + HVXLength = StringRef(A->getValue()).lower(); else if (A->getOption().matches(options::OPT_mhexagon_hvx_double)) HVXLength = "128b"; } // Default hvx-length based on Cpu. else if (HasHVX) - HVXLength = StringRef(getDefaultHvxLength(Cpu)); + HVXLength = getDefaultHvxLength(Cpu); if (!HVXLength.empty()) { HVXFeature = - Args.MakeArgString(llvm::Twine("+hvx-length") + HVXLength.lower()); + Args.MakeArgString(llvm::Twine("+hvx-length") + HVXLength); Features.push_back(HVXFeature); } }
Index: lib/Driver/ToolChains/Hexagon.cpp =================================================================== --- lib/Driver/ToolChains/Hexagon.cpp +++ lib/Driver/ToolChains/Hexagon.cpp @@ -59,7 +59,8 @@ handleHVXWarnings(D, Args); // Add the +hvx* features based on commandline flags. - StringRef HVXFeature, HVXLength; + StringRef HVXFeature; + std::string HVXLength; StringRef Cpu(toolchains::HexagonToolChain::GetTargetCPUVersion(Args)); // Handle -mhvx, -mhvx=, -mno-hvx, -mno-hvx-double. @@ -87,17 +88,17 @@ if (!HasHVX) D.Diag(diag::err_drv_invalid_hvx_length); else if (A->getOption().matches(options::OPT_mhexagon_hvx_length_EQ)) - HVXLength = A->getValue(); + HVXLength = StringRef(A->getValue()).lower(); else if (A->getOption().matches(options::OPT_mhexagon_hvx_double)) HVXLength = "128b"; } // Default hvx-length based on Cpu. else if (HasHVX) - HVXLength = StringRef(getDefaultHvxLength(Cpu)); + HVXLength = getDefaultHvxLength(Cpu); if (!HVXLength.empty()) { HVXFeature = - Args.MakeArgString(llvm::Twine("+hvx-length") + HVXLength.lower()); + Args.MakeArgString(llvm::Twine("+hvx-length") + HVXLength); Features.push_back(HVXFeature); } }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits