Skip to content

Commit f1dfa5e

Browse files
authored
[DviceSanitizer][Coverity] Fix auto-copy issues (#17794)
Fix Coverity reported auto-copy issues.
1 parent 74194eb commit f1dfa5e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4459,7 +4459,7 @@ void FunctionStackPoisoner::processStaticAllocas() {
44594459
AI->replaceAllUsesWith(NewAllocaPtr);
44604460
}
44614461

4462-
auto TargetTriple = Triple(F.getParent()->getTargetTriple());
4462+
const auto &TargetTriple = Triple(F.getParent()->getTargetTriple());
44634463

44644464
// The left-most redzone has enough space for at least 4 pointers.
44654465
Value *BasePlus0 = IRB.CreateIntToPtr(LocalStackBase, IntptrPtrTy);

llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ class MemorySanitizerOnSpirv {
783783
public:
784784
MemorySanitizerOnSpirv(Module &M)
785785
: M(M), C(M.getContext()), DL(M.getDataLayout()) {
786-
auto TargetTriple = Triple(M.getTargetTriple());
786+
const auto &TargetTriple = Triple(M.getTargetTriple());
787787
IsSPIRV = TargetTriple.isSPIROrSPIRV();
788788

789789
IntptrTy = DL.getIntPtrType(C);
@@ -1250,7 +1250,7 @@ PreservedAnalyses MemorySanitizerPass::run(Module &M,
12501250
if (checkIfAlreadyInstrumented(M, "nosanitize_memory"))
12511251
return PreservedAnalyses::all();
12521252
bool Modified = false;
1253-
auto TargetTriple = Triple(M.getTargetTriple());
1253+
const auto &TargetTriple = Triple(M.getTargetTriple());
12541254

12551255
if (!Options.Kernel && !TargetTriple.isSPIROrSPIRV()) {
12561256
insertModuleCtor(M);

0 commit comments

Comments
 (0)