r248480 - [ARM] Follow-up to fix crash "-target arm -mcpu=generic", without "-march="
Vladimir Sukharev via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 24 03:06:45 PDT 2015
Author: vsukharev
Date: Thu Sep 24 05:06:44 2015
New Revision: 248480
URL: http://llvm.org/viewvc/llvm-project?rev=248480&view=rev
Log:
[ARM] Follow-up to fix crash "-target arm -mcpu=generic", without "-march="
Fix of dangling StringRef after temporary std::string is destroyed
Follow-up to: http://reviews.llvm.org/rL248479
Reviewers: alexfh
Subscribers: cfe-commits
Modified:
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=248480&r1=248479&r2=248480&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Sep 24 05:06:44 2015
@@ -6165,7 +6165,7 @@ StringRef arm::getLLVMArchSuffixForARM(S
const llvm::Triple &Triple) {
unsigned ArchKind;
if (CPU == "generic") {
- StringRef ARMArch = tools::arm::getARMArch(Arch, Triple);
+ std::string ARMArch = tools::arm::getARMArch(Arch, Triple);
ArchKind = llvm::ARM::parseArch(ARMArch);
if (ArchKind == llvm::ARM::AK_INVALID)
// In case of generic Arch, i.e. "arm",
More information about the cfe-commits
mailing list