[JITLink][NFC] Make Block const in alignToBlock
authorJob Noorman <jnoorman@igalia.com>
Mon, 3 Apr 2023 07:30:32 +0000 (09:30 +0200)
committerJob Noorman <jnoorman@igalia.com>
Mon, 3 Apr 2023 07:30:32 +0000 (09:30 +0200)
Block is not mutated so can be made const.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D147316

llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h

index 4881565..e778719 100644 (file)
@@ -354,13 +354,13 @@ private:
 };
 
 // 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));
 }