Please review - Fixed code section alignment in JIT mode

Tim Northover t.p.northover at gmail.com
Tue Jul 2 03:15:54 PDT 2013


Hi Elena,

+      // Alignement handling.

Typo.

+      uintptr_t unalignedAddr = (uintptr_t)CurBlock +
sizeof(MemoryRangeHeader);

This makes the function inconsistent about the extra space needed (at
the beginning it's sizeof(CurBlock), here it's
sizeof(MemoryRangeHeader)). It's harmless, but also benefitless as far
as I can tell. It would probably be better to pick one.

+      return (uint8_t *)((unalignedAddr + Alignment - 1) &
+                     ~(uintptr_t)(Alignment - 1));

There's a nice support function in the llvm namespace called
RoundUpToAlignment. I think it would make this line clearer.

Also, does this cause breakage on existing JIT tests or can you add one?

Cheers.

Tim.



More information about the llvm-commits mailing list