Skip to content

Commit f2fa9ac

Browse files
k-kashapovKamil Kashapov
and
Kamil Kashapov
authoredDec 3, 2024··
[nfc][MSan] Change for-loop to ArgNo instead of drop_begin (#117553)
As discussed in #109284 (comment) Changed for loop to use `ArgNo` instead of `drop_begin` to keep loop code consistent with other helpers. Co-authored-by: Kamil Kashapov <[email protected]>
1 parent b206ba1 commit f2fa9ac

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -6159,8 +6159,10 @@ struct VarArgGenericHelper : public VarArgHelperBase {
61596159
unsigned VAArgOffset = 0;
61606160
const DataLayout &DL = F.getDataLayout();
61616161
unsigned IntptrSize = DL.getTypeStoreSize(MS.IntptrTy);
6162-
for (Value *A :
6163-
llvm::drop_begin(CB.args(), CB.getFunctionType()->getNumParams())) {
6162+
for (const auto &[ArgNo, A] : llvm::enumerate(CB.args())) {
6163+
bool IsFixed = ArgNo < CB.getFunctionType()->getNumParams();
6164+
if (IsFixed)
6165+
continue;
61646166
uint64_t ArgSize = DL.getTypeAllocSize(A->getType());
61656167
if (DL.isBigEndian()) {
61666168
// Adjusting the shadow for argument with size < IntptrSize to match the

0 commit comments

Comments
 (0)
Please sign in to comment.