Skip to content

Commit

Permalink
[asan][X86] Change some std::string variables to StringRef. NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Feb 3, 2022
1 parent 5c17f9e commit de88c1a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions llvm/lib/Target/X86/X86MCInstLower.cpp
Expand Up @@ -1347,11 +1347,12 @@ void X86AsmPrinter::LowerASAN_CHECK_MEMACCESS(const MachineInstr &MI) {
AccessInfo.CompileKernel, &ShadowBase,
&MappingScale, &OrShadowOffset);

std::string Name = AccessInfo.IsWrite ? "store" : "load";
std::string Op = OrShadowOffset ? "or" : "add";
std::string SymName = "__asan_check_" + Name + "_" + Op + "_" +
utostr(1ULL << AccessInfo.AccessSizeIndex) + "_" +
TM.getMCRegisterInfo()->getName(Reg.asMCReg());
StringRef Name = AccessInfo.IsWrite ? "store" : "load";
StringRef Op = OrShadowOffset ? "or" : "add";
std::string SymName = ("__asan_check_" + Name + "_" + Op + "_" +
Twine(1ULL << AccessInfo.AccessSizeIndex) + "_" +
TM.getMCRegisterInfo()->getName(Reg.asMCReg()))
.str();
if (OrShadowOffset)
report_fatal_error(
"OrShadowOffset is not supported with optimized callbacks");
Expand Down

0 comments on commit de88c1a

Please sign in to comment.