[PATCH] D41742: [MSF] Fix FPM interval calculation
Colden Cullen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 4 15:33:30 PST 2018
colden added a comment.
Makes sense! Thanks for adding a test btw.
I tested this with my use-case, and it does indeed fix the problem.
================
Comment at: llvm/include/llvm/DebugInfo/MSF/MSFCommon.h:118
+ // the number of fpm blocks.
+ int N = AltFpm ? 2 : 1;
+ return divideCeil(NumBlocks - N, BlockSize);
----------------
Naming nitpick: In other contexts, `AltFpm` implies the opposite of `Msf.SB->FreeBlockMapBlock` (i.e. `3 - FpmBlock`). How about instead of taking that param here, you take an int for `FpmIndex` (or something), require it be 1 or 2, and then in the `MSFLayout` overload you can do the `AltFpm` transformation?
================
Comment at: llvm/include/llvm/DebugInfo/MSF/MSFCommon.h:119
+ int N = AltFpm ? 2 : 1;
+ return divideCeil(NumBlocks - N, BlockSize);
+ }
----------------
Ah, so I was almost right! Just didn't need the +1 on `BlockSize`.
https://reviews.llvm.org/D41742
More information about the llvm-commits
mailing list