[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
llvm-svn: 248480
This commit is contained in:
Vladimir Sukharev 2015-09-24 10:06:44 +00:00
parent 2eef4b52cd
commit a317dfb767
1 changed files with 1 additions and 1 deletions

View File

@ -6165,7 +6165,7 @@ StringRef arm::getLLVMArchSuffixForARM(StringRef CPU, StringRef Arch,
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",