diff options
author | k-kashapov <52855633+k-kashapov@users.noreply.github.com> | 2024-12-04 01:32:54 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-03 14:32:54 -0800 |
commit | f2fa9ac6169758268bc16c46ec80da2e88ad7f2c (patch) | |
tree | 1d47a7c73976f003ca151e1e0f9ac34d64ba16d0 /llvm/lib | |
parent | b206ba1867763a2b09e33649446599538c84d334 (diff) | |
download | llvm-f2fa9ac6169758268bc16c46ec80da2e88ad7f2c.zip llvm-f2fa9ac6169758268bc16c46ec80da2e88ad7f2c.tar.gz llvm-f2fa9ac6169758268bc16c46ec80da2e88ad7f2c.tar.bz2 |
[nfc][MSan] Change for-loop to ArgNo instead of drop_begin (#117553)
As discussed in
https://github.com/llvm/llvm-project/pull/109284#discussion_r1838830571
Changed for loop to use `ArgNo` instead of `drop_begin` to keep loop
code consistent with other helpers.
Co-authored-by: Kamil Kashapov <kashapov@ispras.ru>
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp index dca6bf1..9345005 100644 --- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -6159,8 +6159,10 @@ struct VarArgGenericHelper : public VarArgHelperBase { unsigned VAArgOffset = 0; const DataLayout &DL = F.getDataLayout(); unsigned IntptrSize = DL.getTypeStoreSize(MS.IntptrTy); - for (Value *A : - llvm::drop_begin(CB.args(), CB.getFunctionType()->getNumParams())) { + for (const auto &[ArgNo, A] : llvm::enumerate(CB.args())) { + bool IsFixed = ArgNo < CB.getFunctionType()->getNumParams(); + if (IsFixed) + continue; uint64_t ArgSize = DL.getTypeAllocSize(A->getType()); if (DL.isBigEndian()) { // Adjusting the shadow for argument with size < IntptrSize to match the |