[PATCH] D147316: [JITLink][NFC] Make Block const in alignToBlock
Job Noorman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 31 04:39:17 PDT 2023
jobnoorman created this revision.
jobnoorman added a reviewer: lhames.
Herald added subscribers: asb, pmatos.
Herald added a project: All.
jobnoorman requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Block is not mutated so can be made const.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D147316
Files:
llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
Index: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
===================================================================
--- llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
+++ llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
@@ -354,13 +354,13 @@
};
// Align an address to conform with block alignment requirements.
-inline uint64_t alignToBlock(uint64_t Addr, Block &B) {
+inline uint64_t alignToBlock(uint64_t Addr, const Block &B) {
uint64_t Delta = (B.getAlignmentOffset() - Addr) % B.getAlignment();
return Addr + Delta;
}
// Align a orc::ExecutorAddr to conform with block alignment requirements.
-inline orc::ExecutorAddr alignToBlock(orc::ExecutorAddr Addr, Block &B) {
+inline orc::ExecutorAddr alignToBlock(orc::ExecutorAddr Addr, const Block &B) {
return orc::ExecutorAddr(alignToBlock(Addr.getValue(), B));
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147316.509987.patch
Type: text/x-patch
Size: 855 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230331/698e0758/attachment.bin>
More information about the llvm-commits
mailing list