[PATCH] D41742: [MSF] Fix FPM interval calculation

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 4 15:58:25 PST 2018


zturner added inline comments.


================
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);
----------------
colden wrote:
> colden wrote:
> > 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?
> Follow up question: shouldn't it not matter which FPM you're using?
It only matters insofar as we want to handle that last edge case mentioned in the description of the diff.  It won't matter for your case, but if somehow there were a PDB with *exactly* 4098 blocks (which again, LLD would never generate), then there would be 2 FPM0 intervals and 1 FPM1 interval.  


https://reviews.llvm.org/D41742





More information about the llvm-commits mailing list