From: Fangrui Song Date: Thu, 3 Feb 2022 00:34:35 +0000 (-0800) Subject: [asan][X86] Change some std::string variables to StringRef. NFC X-Git-Tag: upstream/15.0.7~17990 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=de88c1aba2d1523df65aeedeafe575f1dbe45089;p=platform%2Fupstream%2Fllvm.git [asan][X86] Change some std::string variables to StringRef. NFC --- diff --git a/llvm/lib/Target/X86/X86MCInstLower.cpp b/llvm/lib/Target/X86/X86MCInstLower.cpp index 9044f10..2912d09 100644 --- a/llvm/lib/Target/X86/X86MCInstLower.cpp +++ b/llvm/lib/Target/X86/X86MCInstLower.cpp @@ -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");