[X86] Avoid a std::string copy by replacing auto with const auto&. NFC.

Fixes msvc analyzer warning.
This commit is contained in:
Simon Pilgrim 2021-01-21 10:43:07 +00:00
parent 64132f541e
commit 86021d98d3
1 changed files with 5 additions and 5 deletions

View File

@ -2516,11 +2516,11 @@ Value *X86TargetLowering::getIRStackGuard(IRBuilder<> &IRB) const {
if (Offset == (unsigned)-1)
Offset = (Subtarget.is64Bit()) ? 0x28 : 0x14;
auto GuardReg = getTargetMachine().Options.StackProtectorGuardReg;
if (GuardReg == "fs")
AddressSpace = X86AS::FS;
else if (GuardReg == "gs")
AddressSpace = X86AS::GS;
const auto &GuardReg = getTargetMachine().Options.StackProtectorGuardReg;
if (GuardReg == "fs")
AddressSpace = X86AS::FS;
else if (GuardReg == "gs")
AddressSpace = X86AS::GS;
return SegmentOffset(IRB, Offset, AddressSpace);
}
}