[PATCH] D158572: [clang][modules] Use relative offsets for input files

Ben Langmuir via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 23 13:01:42 PDT 2023


benlangmuir added inline comments.


================
Comment at: clang/include/clang/Serialization/ModuleFile.h:249
+  /// Absolute offset of the start of the input-files block.
+  uint64_t InputFilesOffsetBase;
+
----------------
jansvoboda11 wrote:
> benlangmuir wrote:
> > Doesn't `InputFilesCursor` already know where the input files block starts?
> I think it does. We should be able to remove this and always call `InputFilesCursor::GetCurrentBitNo()` at the start. I implemented it this way because it's consistent with the existing pattern: `SLocEntryCursor`/`SourceManagerBlockStartOffset`, `MacroCursor`/`MacroOffsetsBase`, `DeclsCursor`/`DeclsBlockStartOffset`.
> 
> LMK if you feel strongly about it and I can look into getting rid of the extra offset base members.
Since it's consistent with other uses I'm fine with keeping it as-is for this patch. Would be nice to clean them all up in a follow up, but not required.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158572/new/

https://reviews.llvm.org/D158572



More information about the cfe-commits mailing list