diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp index c75b1e3cc4a36..24caeb78a0389 100644 --- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -4369,7 +4369,7 @@ void FunctionStackPoisoner::processStaticAllocas() { AI->replaceAllUsesWith(NewAllocaPtr); } - auto TargetTriple = Triple(F.getParent()->getTargetTriple()); + const auto &TargetTriple = Triple(F.getParent()->getTargetTriple()); // The left-most redzone has enough space for at least 4 pointers. Value *BasePlus0 = IRB.CreateIntToPtr(LocalStackBase, IntptrPtrTy); diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp index bfe570f42257a..d568e9a589c82 100644 --- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -783,7 +783,7 @@ class MemorySanitizerOnSpirv { public: MemorySanitizerOnSpirv(Module &M) : M(M), C(M.getContext()), DL(M.getDataLayout()) { - auto TargetTriple = Triple(M.getTargetTriple()); + const auto &TargetTriple = Triple(M.getTargetTriple()); IsSPIRV = TargetTriple.isSPIROrSPIRV(); IntptrTy = DL.getIntPtrType(C); @@ -1250,7 +1250,7 @@ PreservedAnalyses MemorySanitizerPass::run(Module &M, if (checkIfAlreadyInstrumented(M, "nosanitize_memory")) return PreservedAnalyses::all(); bool Modified = false; - auto TargetTriple = Triple(M.getTargetTriple()); + const auto &TargetTriple = Triple(M.getTargetTriple()); if (!Options.Kernel && !TargetTriple.isSPIROrSPIRV()) { insertModuleCtor(M);