[clang] a5e30f8 - [clang][bytecode][NFC] Avoid creating pointers in CopyArray op (#163042)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Oct 11 23:11:16 PDT 2025
Author: Timm Baeder
Date: 2025-10-12T08:11:12+02:00
New Revision: a5e30f835097d6b210bb7896e6a4dad77b5b4742
URL: https://github.com/llvm/llvm-project/commit/a5e30f835097d6b210bb7896e6a4dad77b5b4742
DIFF: https://github.com/llvm/llvm-project/commit/a5e30f835097d6b210bb7896e6a4dad77b5b4742.diff
LOG: [clang][bytecode][NFC] Avoid creating pointers in CopyArray op (#163042)
Since these are all primitive arrays, use the new `elem()` and
`initializeElement()` functions.
Added:
Modified:
clang/lib/AST/ByteCode/Interp.h
Removed:
################################################################################
diff --git a/clang/lib/AST/ByteCode/Interp.h b/clang/lib/AST/ByteCode/Interp.h
index bb0c4580b14a9..a9c71c771c9ae 100644
--- a/clang/lib/AST/ByteCode/Interp.h
+++ b/clang/lib/AST/ByteCode/Interp.h
@@ -3183,9 +3183,8 @@ inline bool CopyArray(InterpState &S, CodePtr OpPC, uint32_t SrcIndex,
if (!CheckLoad(S, OpPC, SP))
return false;
- const Pointer &DP = DestPtr.atIndex(DestIndex + I);
- DP.deref<T>() = SP.deref<T>();
- DP.initialize();
+ DestPtr.elem<T>(DestIndex + I) = SrcPtr.elem<T>(SrcIndex + I);
+ DestPtr.initializeElement(DestIndex + I);
}
return true;
}
More information about the cfe-commits
mailing list