[llvm] de88c1a - [asan][X86] Change some std::string variables to StringRef. NFC
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 2 16:34:39 PST 2022
Author: Fangrui Song
Date: 2022-02-02T16:34:35-08:00
New Revision: de88c1aba2d1523df65aeedeafe575f1dbe45089
URL: https://github.com/llvm/llvm-project/commit/de88c1aba2d1523df65aeedeafe575f1dbe45089
DIFF: https://github.com/llvm/llvm-project/commit/de88c1aba2d1523df65aeedeafe575f1dbe45089.diff
LOG: [asan][X86] Change some std::string variables to StringRef. NFC
Added:
Modified:
llvm/lib/Target/X86/X86MCInstLower.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86MCInstLower.cpp b/llvm/lib/Target/X86/X86MCInstLower.cpp
index 9044f10ec630..2912d09ab545 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");
More information about the llvm-commits
mailing list