[PATCH] D76295: Use 64 bit integers for bit offsets inside AST file

Dmitry Polukhin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 17 10:10:56 PDT 2020


DmitryPolukhin created this revision.
DmitryPolukhin added a project: clang.
Herald added subscribers: usaxena95, kadircet, ilya-biryukov.

This diff is for discussion how to address problem with large preamble file.

32 bit offsets can be used for PCH/preamble files below 512M. This diff fixes
crashes and asserts on clangd when preamble file exceeds 512M limit. The asserts
usually look like "LLVM ERROR: Invalid abbrev number". On about 700M preamble
files this patch increases file size on about 4%. I tested this diff on
Clang 8, 9 and master.

Test Plan:
Tested on clangd with 700M preamble file. 


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76295

Files:
  clang/include/clang/Serialization/ASTWriter.h
  clang/include/clang/Serialization/ModuleFile.h
  clang/lib/Serialization/ASTReader.cpp
  clang/lib/Serialization/ASTWriter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76295.250806.patch
Type: text/x-patch
Size: 7471 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200317/5f7875e9/attachment.bin>


More information about the cfe-commits mailing list