[PATCH] D39071: [Hexagon] Fix the memory-leak in r316102
Sumanth Gundapaneni via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 18 14:43:32 PDT 2017
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);
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39071.119525.patch
Type: text/x-patch
Size: 1261 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171018/6d1aaf4c/attachment.bin>
More information about the cfe-commits
mailing list